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


C# MenuItem.SetValue方法代码示例

本文整理汇总了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;
 }
开发者ID:rbrother,项目名称:seikkailulaakso,代码行数:20,代码来源:DemoMenu.xaml.cs

示例2: SetGroupName

 public static void SetGroupName(MenuItem element, String value)
 {
     element.SetValue(GroupNameProperty, value);
 }
开发者ID:borndead,项目名称:PoESkillTree,代码行数:4,代码来源:MenuItemExtensions.cs

示例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");
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:FlowchartDesigner.xaml.cs

示例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);
 }
开发者ID:soukoku,项目名称:ModernWPF,代码行数:10,代码来源:MenuItemUI.cs

示例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;
        }
开发者ID:UnaNancyOwen,项目名称:Kinect-Studio-Sample,代码行数:40,代码来源:TreeGrid.cs

示例6: SetGroupName

 public static void SetGroupName(MenuItem menuItem, string value)
 {
     menuItem.SetValue(GroupNameProperty, value);
 }
开发者ID:ruisebastiao,项目名称:Elysium-Extra,代码行数:4,代码来源:MenuItemAttached.cs

示例7: SetCommandStateChangeTrigger

 public static void SetCommandStateChangeTrigger(MenuItem mi, object value)
 {
     mi.SetValue(CommandStateChangeTriggerProperty, value);
 }
开发者ID:squaredinfinity,项目名称:Foundation,代码行数:4,代码来源:MenuItem.Click.cs

示例8: SetClickCommandParameter

 public static void SetClickCommandParameter(MenuItem mi, object value)
 {
     mi.SetValue(ClickCommandParameterProperty, value);
 }
开发者ID:squaredinfinity,项目名称:Foundation,代码行数:4,代码来源:MenuItem.Click.cs

示例9: SetClickCommand

 public static void SetClickCommand(MenuItem mi, ICommand value)
 {
     mi.SetValue(ClickCommandProperty, value);
 }
开发者ID:squaredinfinity,项目名称:Foundation,代码行数:4,代码来源:MenuItem.Click.cs

示例10: SetMenuItemClickCommandBehavior

 static void SetMenuItemClickCommandBehavior(MenuItem mi, MenuItemClickCommandBehavior value)
 {
     mi.SetValue(MenuItemClickCommandBehaviorProperty, value);
 }
开发者ID:squaredinfinity,项目名称:Foundation,代码行数:4,代码来源:MenuItem.Click.cs

示例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);
 }
开发者ID:RichardMarks,项目名称:HandBrakeMirror,代码行数:13,代码来源:DriveMenu.cs

示例12: SetGroupName

 public static void SetGroupName(MenuItem element, string value)
 {
     if (value == null) throw new ArgumentNullException(nameof(value));
     element.SetValue(GroupNameProperty, value);
 }
开发者ID:codekaizen,项目名称:swifttailer,代码行数:5,代码来源:MenuItemExtensions.cs


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