當前位置: 首頁>>代碼示例>>C#>>正文


C# UIElement.GetValue方法代碼示例

本文整理匯總了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); 
        }
開發者ID:sjyanxin,項目名稱:WPFSource,代碼行數:6,代碼來源:DockPanel.cs

示例2: GetLeft

 public static double GetLeft(UIElement element)
 {
     if (element == null) { throw new ArgumentNullException("element"); }
     return (double)element.GetValue(LeftProperty);
 }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:5,代碼來源:Canvas.cs

示例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);
        }
開發者ID:snorp,項目名稱:moon,代碼行數:32,代碼來源:ToolTipService.cs

示例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));
        } 
開發者ID:sjyanxin,項目名稱:WPFSource,代碼行數:14,代碼來源:panel.cs

示例5: GetLeft

		public static float GetLeft ( UIElement ctrl ) {
			return (float)ctrl.GetValue (LeftProperty);
		}
開發者ID:bbqchickenrobot,項目名稱:WPFLight,代碼行數:3,代碼來源:Canvas.cs

示例6: GetTop

		public static float GetTop ( UIElement ctrl ) {
			return (float)ctrl.GetValue (TopProperty);
		}
開發者ID:bbqchickenrobot,項目名稱:WPFLight,代碼行數:3,代碼來源:Canvas.cs

示例7: GetColumnSpan

		public static int GetColumnSpan (UIElement item) {
			return ( int ) item.GetValue (ColumnSpanProperty);
		}
開發者ID:bbqchickenrobot,項目名稱:WPFLight,代碼行數:3,代碼來源:Grid.cs

示例8: GetRowSpan

		public static int GetRowSpan (UIElement item) {
			return ( int ) item.GetValue (RowSpanProperty);
		}
開發者ID:bbqchickenrobot,項目名稱:WPFLight,代碼行數:3,代碼來源:Grid.cs


注:本文中的System.Windows.Controls.UIElement.GetValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。