Esempio n. 1
0
        public static Dock GetDock(UIElement element)
        { 
            if (element == null) { throw new ArgumentNullException("element"); } 

            return (Dock) element.GetValue(DockProperty); 
        }
Esempio n. 2
0
 public static double GetLeft(UIElement element)
 {
     if (element == null) { throw new ArgumentNullException("element"); }
     return (double)element.GetValue(LeftProperty);
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        /// <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));
        } 
Esempio n. 5
0
		public static float GetLeft ( UIElement ctrl ) {
			return (float)ctrl.GetValue (LeftProperty);
		}
Esempio n. 6
0
		public static float GetTop ( UIElement ctrl ) {
			return (float)ctrl.GetValue (TopProperty);
		}
Esempio n. 7
0
		public static int GetColumnSpan (UIElement item) {
			return ( int ) item.GetValue (ColumnSpanProperty);
		}
Esempio n. 8
0
		public static int GetRowSpan (UIElement item) {
			return ( int ) item.GetValue (RowSpanProperty);
		}