/// <summary> /// Initializes a new instance of the <see cref="ModernMenu"/> class. /// </summary> public ModernMenu() { this.AddHandler(CommandManager.CanExecuteEvent, new CanExecuteRoutedEventHandler((o, e) => LinkCommands.OnCanNavigateLink(this, o as UIElement, e)), handledEventsToo: true); var commandBinding = LinkCommands.CreateNavigateLinkCommandBinding(this); this.CommandBindings.Add(commandBinding); }
public LinkGroup() { this.SetValue(LinksPropertyKey, new LinkGroupLinks()); var commandBinding = LinkCommands.CreateNavigateLinkCommandBinding(this); this.CommandBindings.Add(commandBinding); this.Command = LinkCommands.NavigateLink; }
/// <summary> /// Initializes a new instance of the <see cref="ModernWindow"/> class. /// </summary> public ModernWindow() { // create empty collections SetValue(MainMenuProperty, new ModernMenu()); SetValue(TitleLinksProperty, new TitleLinks()); // associate window commands with this instance this.CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, OnCloseWindow)); this.CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand, OnMaximizeWindow, OnCanResizeWindow)); this.CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand, OnMinimizeWindow, OnCanMinimizeWindow)); this.CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand, OnRestoreWindow, OnCanResizeWindow)); // associate navigate link command with this instance var commandBinding = LinkCommands.CreateNavigateLinkCommandBinding(this); this.CommandBindings.Add(commandBinding); // listen for theme changes AppearanceManager.Current.PropertyChanged += OnAppearanceManagerPropertyChanged; }
public ModernLinks() { var commandBinding = LinkCommands.CreateNavigateLinkCommandBinding(this); this.CommandBindings.Add(commandBinding); }