當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。