本文整理汇总了C#中FrameworkElement.?.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# FrameworkElement.?.SetValue方法的具体用法?C# FrameworkElement.?.SetValue怎么用?C# FrameworkElement.?.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameworkElement
的用法示例。
在下文中一共展示了FrameworkElement.?.SetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SuspendScroll
private static void SuspendScroll(object sender, RoutedEventArgs e)
{
var blockingElement = sender as FrameworkElement;
// Determines the parent Panorama/Pivot control
if (_internalPanningControl == null)
#if NETFX_CORE
_internalPanningControl = FindAncestor(blockingElement, p => p is Hub || p is FlipView) as FrameworkElement;
_internalPanningControl = FindAncestor(blockingElement, p => p is Pivot || p is Hub || p is FlipView) as FrameworkElement;
#elif SILVERLIGHT
_internalPanningControl = FindAncestor(blockingElement, p => p is Pivot || p is Panorama) as FrameworkElement;
#endif
if (_internalPanningControl != null && (bool)_internalPanningControl.GetValue(IsScrollSuspendedProperty))
return;
// When the user touches the control...
var originalSource = e.OriginalSource as DependencyObject;
if (FindAncestor(originalSource, dobj => dobj == blockingElement) != blockingElement)
return;
// Mark the parent Panorama/Pivot for scroll suspension
// and register for touch frame events
_internalPanningControl?.SetValue(IsScrollSuspendedProperty, true);
#if NETFX_CORE
CoreWindow.GetForCurrentThread().PointerReleased += PreventScrollBinding_PointerReleased;
#elif SILVERLIGHT
Touch.FrameReported += TouchFrameReported;
#endif
if (blockingElement != null)
blockingElement.IsHitTestVisible = true;
if (_internalPanningControl != null)
_internalPanningControl.IsHitTestVisible = false;
}