本文整理汇总了C#中System.Windows.Controls.UIElement.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# UIElement.GetValue方法的具体用法?C# UIElement.GetValue怎么用?C# UIElement.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.UIElement
的用法示例。
在下文中一共展示了UIElement.GetValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDock
public static Dock GetDock(UIElement element)
{
if (element == null) { throw new ArgumentNullException("element"); }
return (Dock) element.GetValue(DockProperty);
}
示例2: GetLeft
public static double GetLeft(UIElement element)
{
if (element == null) { throw new ArgumentNullException("element"); }
return (double)element.GetValue(LeftProperty);
}
示例3: UnregisterToolTip
private static void UnregisterToolTip(UIElement owner)
{
Debug.Assert(owner != null, "owner element is required");
if (owner.GetValue (AssignedToolTipProperty) == null)
{
return;
}
owner.MouseEnter -= new MouseEventHandler(OnOwnerMouseEnter);
owner.MouseLeave -= new MouseEventHandler(OnOwnerMouseLeave);
owner.MouseLeftButtonDown -= new MouseButtonEventHandler(OnOwnerMouseLeftButtonDown);
owner.KeyDown -= new KeyEventHandler(OnOwnerKeyDown);
ToolTip toolTip = (ToolTip) owner.GetValue (AssignedToolTipProperty);
if (toolTip.IsOpen)
{
if (toolTip == ToolTipService._currentToolTip)
{
// unregistering a currently open automatic toltip
// thus need to stop the timer
ToolTipService._closeTimer.Stop();
ToolTipService._currentToolTip = null;
ToolTipService._owner = null;
ToolTipService._lastEnterSource = null;
}
toolTip.IsOpen = false;
}
owner.ClearValue (AssignedToolTipProperty);
}
示例4: GetZIndex
/// <summary>
/// Helper for reading ZIndex property from a UIElement.
/// </summary>
/// <param name="element">UIElement to read ZIndex property from.</param>
/// <returns>ZIndex property value.</returns>
public static int GetZIndex(UIElement element)
{
if (element == null)
{
throw new ArgumentNullException("element");
}
return ((int)element.GetValue(ZIndexProperty));
}
示例5: GetLeft
public static float GetLeft ( UIElement ctrl ) {
return (float)ctrl.GetValue (LeftProperty);
}
示例6: GetTop
public static float GetTop ( UIElement ctrl ) {
return (float)ctrl.GetValue (TopProperty);
}
示例7: GetColumnSpan
public static int GetColumnSpan (UIElement item) {
return ( int ) item.GetValue (ColumnSpanProperty);
}
示例8: GetRowSpan
public static int GetRowSpan (UIElement item) {
return ( int ) item.GetValue (RowSpanProperty);
}