当前位置: 首页>>代码示例>>C#>>正文


C# UIElement.GetValue方法代码示例

本文整理汇总了C#中UIElement.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# UIElement.GetValue方法的具体用法?C# UIElement.GetValue怎么用?C# UIElement.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIElement的用法示例。


在下文中一共展示了UIElement.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HookUpEvents

        private void HookUpEvents(UIElement uiElement)
        {
            // VisualTreeHelper.GetParent(uiElement) as UIElement;

            uiElement.MouseEnter += (sender, o) => { logger.Trace("OnMouseEnter {0}", uiElement.GetValue(NameProperty)); };
            uiElement.MouseLeave += (sender, o) => { logger.Trace("OnMouseLeave {0}", uiElement.GetValue(NameProperty)); };
        }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:7,代码来源:MainPage.xaml.cs

示例2: StartAnimation

        /// <summary>
        /// Starts an animation to a particular value on the specified dependency property.
        /// You can pass in an event handler to call when the animation has completed.
        /// </summary>
        public static void StartAnimation(UIElement animatableElement, DependencyProperty dependencyProperty, double toValue, double animationDurationSeconds, EventHandler completedEvent)
        {
            double fromValue = (double)animatableElement.GetValue(dependencyProperty);

            DoubleAnimation animation = new DoubleAnimation();
            animation.From = fromValue;
            animation.To = toValue;
            animation.Duration = TimeSpan.FromSeconds(animationDurationSeconds);

            animation.Completed += delegate(object sender, EventArgs e)
            {
                //
                // When the animation has completed bake final value of the animation
                // into the property.
                //
                animatableElement.SetValue(dependencyProperty, animatableElement.GetValue(dependencyProperty));
                CancelAnimation(animatableElement, dependencyProperty);

                if (completedEvent != null)
                {
                    completedEvent(sender, e);
                }
            };

            //TODO// animation.Freeze();

            //TODO// animatableElement.BeginAnimation(dependencyProperty, animation);
        }
开发者ID:Zoomicon,项目名称:ZUI,代码行数:32,代码来源:AnimationHelper.cs

示例3: CellRange

 /// <summary>
 ///     Initializes a new instance of a <see cref="T:C1.WPF.FlexGrid.CellRange" /> based on a
 ///     <see cref="T:System.Windows.UIElement" /> that represents a cell.
 /// </summary>
 /// <param name="e">
 ///     <see cref="T:System.Windows.UIElement" /> that represents a cell.
 /// </param>
 public CellRange(UIElement e)
 {
     if (e.ReadLocalValue(Grid.RowProperty) == DependencyProperty.UnsetValue)
     {
         _row = _col = _row2 = _col2 = -1;
         return;
     }
     _row = (int) e.GetValue(Grid.RowProperty);
     _col = (int) e.GetValue(Grid.ColumnProperty);
     _row2 = _row + (int) e.GetValue(Grid.RowSpanProperty) - 1;
     _col2 = _col + (int) e.GetValue(Grid.ColumnSpanProperty) - 1;
 }
开发者ID:mdjabirov,项目名称:C1Decompiled,代码行数:19,代码来源:CellRange.cs

示例4: GetDock

        public static Dock GetDock(UIElement element)
        {
            if (element == null)
                throw new ArgumentNullException("element");

            return (Dock)element.GetValue(DockProperty);
        }
开发者ID:ComponentFactory,项目名称:Quicksilver,代码行数:7,代码来源:DockLayout.cs

示例5: GetCanBeDragged

        public static bool GetCanBeDragged(UIElement uiElement)
        {
            if (uiElement == null)
                return false;

            return (bool)uiElement.GetValue(CanBeDraggedProperty);
        }
开发者ID:alexguirre,项目名称:Emergency-Strobes,代码行数:7,代码来源:DragCanvas.cs

示例6: GetRight

 public static double GetRight(UIElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return (double)element.GetValue(RightProperty);
 }
开发者ID:phr34k,项目名称:vdsl,代码行数:8,代码来源:ResizeableCanvas.cs

示例7: GetIsMemoryEfficient

 /// <summary>
 /// Gets the value of the IsMemoryEfficient attached property for a specified UIElement.
 /// </summary>
 /// <param name="element">The UIElement from which the property value is read.</param>
 /// <returns>The IsMemoryEfficient property value for the UIElement.</returns>
 public static bool GetIsMemoryEfficient(UIElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return (bool)element.GetValue(IsMemoryEfficientProperty);
 }
开发者ID:TediWang,项目名称:4thandmayor-ancient,代码行数:13,代码来源:LoadingPivotItem.cs

示例8: GetTabIndex

 /// <summary>
 /// Gets an integer representing the specified <see cref="UIElement"/>'s Tab index
 /// </summary>
 /// <param name="element">The <see cref="UIElement"/> who's Tab index is to return</param>
 /// <returns>An integer</returns>
 public static int GetTabIndex(UIElement element)
 {
     if (!element.DependencyProperties.ContainsKey(KeyboardNavigation.TabIndexProperty))
     {
         return -1;
     }
     return element.GetValue<int>(KeyboardNavigation.TabIndexProperty);
 }
开发者ID:yonglehou,项目名称:Photon,代码行数:13,代码来源:KeyboardNavigation.cs

示例9: GetOffset

 /// <summary>
 /// Gets a <see cref="Media.Point"/> representing the specified <see cref="UIElement"/>'s offset
 /// </summary>
 /// <param name="element">The <see cref="UIElement"/> to get the offset of</param>
 /// <returns>A <see cref="Media.Point"/> representing the specified <see cref="UIElement"/>'s offset</returns>
 public static Media.Point GetOffset(UIElement element)
 {
     if (!element.DependencyProperties.ContainsKey(StackPanel.OffsetProperty))
     {
         throw new ArgumentException("The UIElement passed as 'element' argument is not the child of a StackPanel");
     }
     return element.GetValue<Media.Point>(StackPanel.OffsetProperty);
 }
开发者ID:yonglehou,项目名称:Photon,代码行数:13,代码来源:StackPanel.cs

示例10: GetIsTabStop

 /// <summary>
 /// Gets a boolean indicating whether or not the specified element is a Tab stop
 /// </summary>
 /// <param name="element">The <see cref="UIElement"/> to check</param>
 /// <returns>A boolean</returns>
 public static bool GetIsTabStop(UIElement element)
 {
     if (!element.DependencyProperties.ContainsKey(KeyboardNavigation.IsTabStopProperty))
     {
         return false;
     }
     return element.GetValue<bool>(KeyboardNavigation.IsTabStopProperty);
 }
开发者ID:yonglehou,项目名称:Photon,代码行数:13,代码来源:KeyboardNavigation.cs

示例11: GetTop

 public static double GetTop(UIElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return (double)element.GetValue(Canvas.TopProperty);
 }
开发者ID:evnik,项目名称:UIFramework,代码行数:8,代码来源:Canvas.cs

示例12: GetCanvasProperty

		static double GetCanvasProperty(UIElement element, DependencyProperty d)
		{
			double v = (double)element.GetValue(d);
			if (double.IsNaN(v))
				return 0;
			else
				return v;
		}
开发者ID:fanyjie,项目名称:SharpDevelop,代码行数:8,代码来源:CanvasPlacementSupport.cs

示例13: GetRelativePosition

 public static Point GetRelativePosition(UIElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return (Point)element.GetValue(RelativePositionProperty);
 }
开发者ID:wxanywhere,项目名称:WX_COMPONENT,代码行数:8,代码来源:RelativePositionPanel.cs

示例14: GetTop

		static double GetTop(UIElement element)
		{
			double v = (double)element.GetValue(Canvas.TopProperty);
			if (double.IsNaN(v))
				return 0;
			else
				return v;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:CanvasPlacementSupport.cs

示例15: GetEdge

 public static Edge GetEdge(UIElement element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return (Edge)element.GetValue(EdgeProperty);
 }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:8,代码来源:EdgePanel.cs


注:本文中的UIElement.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。