本文整理汇总了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);
}
示例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);
//}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例7: SetDialogResult
public static void SetDialogResult(UserControl target, bool? value)
{
target.SetValue(DialogResultProperty, value);
}