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


C# UserControl.SetValue方法代码示例

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


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

示例1: AddActivityToInnerCanvas

 public void AddActivityToInnerCanvas(UserControl activity, MouseEventArgs mouse)
 {
     Point posAtCanvas = mouse.GetPosition(ForLoopInnerCanvas);
     activity.SetValue(Canvas.TopProperty, posAtCanvas.Y);
     activity.SetValue(Canvas.LeftProperty, posAtCanvas.X);
     ForLoopInnerCanvas.Children.Add(activity);
     _nestedActivities.Add(activity as IActivityComponent);
 }
开发者ID:SamuelToh,项目名称:Masters_Degree_Major_Project,代码行数:8,代码来源:ForLoopComponent.xaml.cs

示例2: ControlMouseDown

 private void ControlMouseDown(object sender, MouseButtonEventArgs e)
 {
     if (sender.GetType().IsSubclassOf(typeof(UserControl)))
     {
         cardDragging = true;
         canvasDragging = false;
         CanvasScroll.PanningMode = PanningMode.None;
         uc = (UserControl)sender;
         uc.SetValue(Canvas.ZIndexProperty, count++); // Slutty :D
     }
     //else if (sender.GetType() == typeof(Canvas) && cardDragging != true)
     //{
     //    cardDragging = false;
     //    canvasDragging = true;
     //    startMousePos = e.GetPosition(null);
     //}
 }
开发者ID:UBM,项目名称:WPF-Sprint-Board,代码行数:17,代码来源:Board.xaml.cs

示例3: SetScriptView

		public void SetScriptView(object viewAsObject)
		{
			if (object.ReferenceEquals(_scriptView, viewAsObject))
				return;

			if (null != _scriptView)
			{
				this._mainGrid.Children.Remove(_scriptView);
			}

			_scriptView = (UserControl)viewAsObject;

			if (null != _scriptView)
			{
				_scriptView.SetValue(Grid.ColumnProperty, 0);
				_scriptView.SetValue(Grid.ColumnSpanProperty, 5);
				_scriptView.SetValue(Grid.RowProperty, 3);
				this._mainGrid.Children.Add(_scriptView);
			}
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:20,代码来源:FitFunctionScriptControl.xaml.cs

示例4: AssociateWidget

        internal void AssociateWidget(Widget widget, UserControl userControl)
        {
            int widgetIndex = ((int)widget);
            if (null == widgets[widgetIndex])
            {
                widgets[widgetIndex] = userControl;

                // GRIDLAYOUTSPECIFIC: Revise this logic if grid changes.
                userControl.SetValue(Grid.RowProperty, 5);
                if (mainEditorGrid.Children.Add(userControl) != -1)
                {
                    if (userControl.Visibility != System.Windows.Visibility.Visible)
                        userControl.Visibility = System.Windows.Visibility.Visible;

                    mainEditorGrid.UpdateLayout();
                }

                // Display the button corresponding to the widget.
                toggleButtons[widgetIndex].Visibility = Visibility.Visible;
            }

            // Toggle the corresponding button first...
            for (int index = 0; index < toggleButtons.Length; ++index)
            {
                bool isChecked = (index == ((int)widget));
                toggleButtons[index].IsChecked = isChecked;
            }

            // Start the transition to show the widgets.
            BringWidgetToForeground(widget);
            DisplayWidgets(true);
        }
开发者ID:samuto,项目名称:designscript,代码行数:32,代码来源:EditorWidgetBar.xaml.cs

示例5: SetViewModel

 /// <summary>
 /// Sets the view model instance attached to the specified control.
 /// The view model is also used as the DataContext assigned to the control.
 /// </summary>
 /// <param name="userControl">The control to associated the view model with.</param>
 /// <param name="value">The view model instance.</param>
 public static void SetViewModel(UserControl userControl, object value)
 {
     userControl.SetValue(ViewModelProperty, value);
     userControl.DataContext = value;
 }
开发者ID:nikhilk,项目名称:silverlightfx,代码行数:11,代码来源:ViewModelAttribute.cs

示例6: SetViewModel

 /// <summary>
 /// Sets the view model instance attached to the specified control.
 /// The view model is also used as the DataContext assigned to the control.
 /// </summary>
 /// <param name="userControl">The control to associated the view model with.</param>
 /// <param name="value">The view model instance.</param>
 public static void SetViewModel(UserControl userControl, object value)
 {
     userControl.SetValue(ModelProperty, value);
 }
开发者ID:nikhilk,项目名称:silverlightfx,代码行数:10,代码来源:View.cs

示例7: SetDialogResult

 public static void SetDialogResult(UserControl target, bool? value)
 {
     target.SetValue(DialogResultProperty, value);
 }
开发者ID:taras-pyvovarov,项目名称:WpfRef,代码行数:4,代码来源:DialogCloser.cs


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