Пример #1
0
        /// <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);
        }
Пример #2
0
        public LinkGroup()
        {
            this.SetValue(LinksPropertyKey, new LinkGroupLinks());
            var commandBinding = LinkCommands.CreateNavigateLinkCommandBinding(this);

            this.CommandBindings.Add(commandBinding);
            this.Command = LinkCommands.NavigateLink;
        }
Пример #3
0
        /// <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;
        }
Пример #4
0
        public ModernLinks()
        {
            var commandBinding = LinkCommands.CreateNavigateLinkCommandBinding(this);

            this.CommandBindings.Add(commandBinding);
        }