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


C# UIElement.SetValue方法代码示例

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


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

示例1: AddElement

        public void AddElement(UIElement element, int x, int y)
        {
            if(element == null)
                return;

            element.SetValue(ColumnProperty, x);
            element.SetValue(RowProperty, y);
            Children.Add(element);
        }
开发者ID:kmorcinek,项目名称:hello_wars,代码行数:9,代码来源:TankBlasterGridControl.cs

示例2: AddChildInCanvas

 public void AddChildInCanvas(UIElement control)
 {
     if (canvas.Children.Count == 0)
     {
         canvas.Children.Add(control);
         control.SetValue(Canvas.LeftProperty, 0d);
         control.SetValue(Canvas.TopProperty, 0d);
     }
 }
开发者ID:yoursalary,项目名称:EPL,代码行数:9,代码来源:DragControlBowl.xaml.cs

示例3: AddChild

        public static void AddChild(this Grid grid, UIElement control, int row, int column)
        {
            control.SetValue(Grid.RowProperty, row);
            control.SetValue(Grid.ColumnProperty, column);

            grid.Children.Add(control);
        }
开发者ID:adamkrieger,项目名称:CustomControlLibrary_WP8,代码行数:7,代码来源:GridExtensions.cs

示例4: CompletionControl

        public CompletionControl(UIElement view, ICompletionSession session)
        {
            InitializeComponent();

            _view = view;
            _warning.Foreground = SystemColors.HotTrackBrush;
            _warning.Text = J.Tools.Resources.WarningAnalysisNotCurrent;

            if (session.TextView.GetAnalyzer().InterpreterFactory.IsAnalysisCurrent()) {
                _warning.Visibility = System.Windows.Visibility.Collapsed;
            }

            view.SetValue(Grid.RowProperty, 0);
            view.SetValue(Grid.ColumnProperty, 0);
            _grid.Children.Add(view);

            var content = view as ContentControl;
            if (content != null) {
                content.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
                content.Width = Width;
                content.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch;
            }

            session.Dismissed += SessionDismissed;
        }
开发者ID:borota,项目名称:JTVS,代码行数:25,代码来源:CompletionControl.xaml.cs

示例5: SetGridColumnRow

        private UIElement SetGridColumnRow(UIElement input, int row, int column)
        {
            input.SetValue(RowProperty, row);
            input.SetValue(ColumnProperty, column);

            return input;
        }
开发者ID:Zeeger,项目名称:sqlassist,代码行数:7,代码来源:DataCellViewer.cs

示例6: SetIsTabStop

 /// <summary>
 /// Sets a boolean indicating whether or not the specified element is a Tab stop
 /// </summary>
 /// <param name="element">The <see cref="UIElement"/> to set</param>
 /// <param name="isTabStop">A boolean indicating whether or not the element is a Tab stop element</param>
 public static void SetIsTabStop(UIElement element, bool isTabStop)
 {
     IUIElement focusScopeElement;
     HashSet<UIElement> focusables;
     int index;
     if (!element.DependencyProperties.ContainsKey(KeyboardNavigation.IsTabStopProperty))
     {
         KeyboardNavigation.AppendKeyboardNavigationProperties(element);
     }
     focusScopeElement = FocusManager.GetFocusScopeElement(element);
     if (focusScopeElement == null)
     {
         return;
     }
     element.SetValue(KeyboardNavigation.IsTabStopProperty, isTabStop);
     focusables = focusScopeElement.GetValue<HashSet<UIElement>>(FocusManager.FocusableElementsProperty);
     if (focusables.Contains(element))
     {
         return;
     }
     if(focusables.Count > 0)
     {
         index = focusables.Max(elem => elem.GetValue<int>(KeyboardNavigation.TabIndexProperty));
     }
     else
     {
         index = 0;
     }
     element.SetValue(KeyboardNavigation.TabIndexProperty, index);
 }
开发者ID:yonglehou,项目名称:Photon,代码行数:35,代码来源:KeyboardNavigation.cs

示例7: DialogShellViewWpf

		public DialogShellViewWpf(System.Windows.UIElement hostedControl)
			: this()
		{
			_hostedControl = hostedControl;
			_hostedControl.SetValue(Grid.RowProperty, 0);
			_hostedControl.SetValue(Grid.ColumnProperty, 0);
			_grid.Children.Add(_hostedControl);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:8,代码来源:DialogShellViewWpf.xaml.cs

示例8: SetIsVisible

		public static void SetIsVisible(UIElement control, bool? isVisible)
		{
			control.SetValue(IsVisibleProperty, isVisible);

			if (isVisible == null)
				return;

			control.SetValue(UIElement.VisibilityProperty, isVisible.Value ? Visibility.Visible : Visibility.Collapsed);
		}
开发者ID:justdude,项目名称:DbExport,代码行数:9,代码来源:ControlBehavior.cs

示例9: AddUiElement

        public void AddUiElement(UIElement uiElement, int row, int col, int rowSpan = 0, int colSpan = 0)
        {
            if (row > 0) uiElement.SetValue(RowProperty, row);
            if (col > 0) uiElement.SetValue(ColumnProperty, col);
            if (rowSpan > 0) uiElement.SetValue(RowSpanProperty, rowSpan);
            if (colSpan > 0) uiElement.SetValue(ColumnSpanProperty, colSpan);

            Children.Add(uiElement);
        }
开发者ID:kidaa,项目名称:Pulse,代码行数:9,代码来源:UiGrid.cs

示例10: AddElement

        public void AddElement(UIElement el)
        {
            var rowDefinition = new RowDefinition();
            rowDefinition.Height = GridLength.Auto;
            viewGrid.RowDefinitions.Add(rowDefinition);

            el.SetValue(Grid.RowProperty, newRow++);
            el.SetValue(Grid.ColumnProperty, 0);
            this.viewGrid.Children.Add(el);

            //this.viewStack.Children.Add(el);
        }
开发者ID:Ace4teaM,项目名称:Arduino-Project,代码行数:12,代码来源:EditWnd.xaml.cs

示例11: SetDetailControl

		public void SetDetailControl(object detailControl)
		{
			if (_detailControl != null)
				_mainGrid.Children.Remove(_detailControl);

			_detailControl = (UIElement)detailControl;

			if (null != _detailControl)
			{
				_detailControl.SetValue(Grid.RowProperty, 4);
				_detailControl.SetValue(Grid.ColumnProperty, 2);
				_mainGrid.Children.Add(_detailControl);
			}
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:14,代码来源:InterpolationControl.xaml.cs

示例12: SetDock

        /// <summary>
        /// Sets the value of the Dock attached property to a specified element.
        /// </summary>
        /// <param name="element">The element to which the attached property is written.</param>
        /// <param name="dock">The new Dock value.</param>
        public static void SetDock(UIElement element, Dock dock)
        {
            if (element == null)
                throw new ArgumentNullException("element");

            element.SetValue(DockProperty, dock);
        }
开发者ID:ComponentFactory,项目名称:Quicksilver,代码行数:12,代码来源:DockLayout.cs

示例13: 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

示例14: SetPosition

 public static void SetPosition(UIElement element, Position position)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     element.SetValue(PositionProperty, position);
 }
开发者ID:goutkannan,项目名称:ironlab,代码行数:8,代码来源:PlotPanelBase.cs

示例15: SetIsMemoryEfficient

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


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