本文整理汇总了C#中System.Windows.FrameworkElement.GetRelativePositionIn方法的典型用法代码示例。如果您正苦于以下问题:C# FrameworkElement.GetRelativePositionIn方法的具体用法?C# FrameworkElement.GetRelativePositionIn怎么用?C# FrameworkElement.GetRelativePositionIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.FrameworkElement
的用法示例。
在下文中一共展示了FrameworkElement.GetRelativePositionIn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HoldGesture
private void HoldGesture(object sender, GestureEventArgs e)
{
if (!IsEnabled)
return;
IsActive = true;
_cardView = sender as CardView;
if (_cardView == null)
{
IsActive = false;
}
else
{
var selected = (CardViewModel)_cardView.DataContext;
var scrollOffset = new Point(_scrollViewer.HorizontalOffset, _scrollViewer.VerticalOffset);
_originalRelativePosition = _cardView.GetRelativePositionIn(_context, scrollOffset);
// Fade everything out
//if (_context != null)
// _context.Animate(1.0, 0.7, UIElement.OpacityProperty, 300, 0);
if (_context != null)
FadeCards(_context, selected);
// Popout the selected card
// PopoutCard(_cardView, _draggedImage, _originalRelativePosition, scrollOffset);
// We can allow children to listen to events now
EnableChildInteractions();
}
}
示例2: Create
public static Value Create(string id, FrameworkElement element, FrameworkElement relativeTo)
{
var position = element.GetRelativePositionIn(relativeTo);
var rect = new Rect(position, element.RenderSize);
return new Value
{
Id = id,
Position = rect
};
}
示例3: HoldStarted
private void HoldStarted(object sender, GestureEventArgs e)
{
if (!IsEnabled)
return;
_cardView = sender as CardView;
if (_cardView == null)
{
IsActive = false;
}
else
{
var scrollOffset = new Point(_scrollViewer.HorizontalOffset, _scrollViewer.VerticalOffset);
var originalPosition = _cardView.GetRelativePositionIn(_itemsControl, scrollOffset);
_initialIndex = _currentIndex = _pointIndex.IndexOf(originalPosition);
}
}