本文整理汇总了C#中System.Windows.Controls.MenuItem.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# MenuItem.SetValue方法的具体用法?C# MenuItem.SetValue怎么用?C# MenuItem.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.MenuItem
的用法示例。
在下文中一共展示了MenuItem.SetValue方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DemoMenu
public DemoMenu()
{
InitializeComponent();
Canvas c = ir;
_resume = new MenuItem();
_resume.SetValue(Canvas.LeftProperty, Convert.ToDouble(175));
_resume.SetValue(Canvas.TopProperty, Convert.ToDouble(320));
_resume.Text = "Resume Demo";
_resume.Index = 0;
WireUpMouseEvents(_resume);
c.Children.Add(_resume);
_quit = new MenuItem();
_quit.SetValue(Canvas.LeftProperty, Convert.ToDouble(175));
_quit.SetValue(Canvas.TopProperty, Convert.ToDouble(360));
_quit.Text = "Quit Demo";
_quit.Index = 1;
WireUpMouseEvents(_quit);
c.Children.Add(_quit);
Loaded += DemoMenu_Loaded;
}
示例2: SetGroupName
public static void SetGroupName(MenuItem element, String value)
{
element.SetValue(GroupNameProperty, value);
}
示例3: ConstructSetAsStartNodeMenuItem
void ConstructSetAsStartNodeMenuItem()
{
setAsStartNode = new MenuItem();
setAsStartNode.Command = FlowchartDesigner.SetAsStartNodeCommand;
setAsStartNode.Header = this.SetAsStartNodeMenuItemHeader;
setAsStartNode.Visibility = Visibility.Collapsed;
setAsStartNode.Loaded += new RoutedEventHandler(OnSetAsStartNodeLoaded);
//AutomationProperties
setAsStartNode.SetValue(System.Windows.Automation.AutomationProperties.AutomationIdProperty, "SetAsStartNodeMenuItem");
}
示例4: SetGroupName
/// <summary>
/// Sets the GroupName property for this object.
/// </summary>
/// <param name="element">The element.</param>
/// <param name="value">The value.</param>
public static void SetGroupName(MenuItem element, String value)
{
if (element == null) { throw new ArgumentNullException("element"); }
element.SetValue(GroupNameProperty, value);
}
示例5: CloneContextMenuItem
object CloneContextMenuItem(object obj)
{
if (obj is Separator)
{
return new Separator();
}
var item = obj as MenuItem;
if (item == null)
{
return obj;
}
var clone = new MenuItem();
foreach (var dp in clonedMenuItemProperties)
{
var binding = BindingOperations.GetBinding(item, dp);
if (binding != null)
{
clone.SetBinding(dp, binding);
}
else
{
clone.SetValue(dp, item.GetValue(dp));
}
}
if (item.Items.Count > 0)
{
foreach (var child in item.Items.OfType<object>())
{
clone.Items.Add(CloneContextMenuItem(child));
}
}
return clone;
}
示例6: SetGroupName
public static void SetGroupName(MenuItem menuItem, string value)
{
menuItem.SetValue(GroupNameProperty, value);
}
示例7: SetCommandStateChangeTrigger
public static void SetCommandStateChangeTrigger(MenuItem mi, object value)
{
mi.SetValue(CommandStateChangeTriggerProperty, value);
}
示例8: SetClickCommandParameter
public static void SetClickCommandParameter(MenuItem mi, object value)
{
mi.SetValue(ClickCommandParameterProperty, value);
}
示例9: SetClickCommand
public static void SetClickCommand(MenuItem mi, ICommand value)
{
mi.SetValue(ClickCommandProperty, value);
}
示例10: SetMenuItemClickCommandBehavior
static void SetMenuItemClickCommandBehavior(MenuItem mi, MenuItemClickCommandBehavior value)
{
mi.SetValue(MenuItemClickCommandBehaviorProperty, value);
}
示例11: SetShowAvailableDrives
/// <summary>
/// The set show available drives.
/// </summary>
/// <param name="element">
/// The element.
/// </param>
/// <param name="value">
/// The value.
/// </param>
public static void SetShowAvailableDrives(MenuItem element, Boolean value)
{
element.SetValue(ShowAvailableDrivesProperty, value);
}
示例12: SetGroupName
public static void SetGroupName(MenuItem element, string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
element.SetValue(GroupNameProperty, value);
}