Ejemplo n.º 1
0
        /// <summary>
        /// Occurs when a docking-related context menu is opening, allowing for customization before it is displayed.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">The <c>DockingMenuEventArgs</c> that contains data related to this event.</param>
        private void OnDockSiteMenuOpening(object sender, DockingMenuEventArgs e)
        {
            var sb = new StringBuilder(String.Format("WindowContextMenu: Kind={0}", e.Kind));

            if (e.Window != null)
            {
                sb.AppendFormat(", Title={0} ", e.Window.Title);

                if (e.Window == outputToolWindow)
                {
                    e.Menu.Items.Add(new Separator());

                    var menuItem = new MenuItem()
                    {
                        Header = "Activation Events", IsCheckable = true
                    };
                    menuItem.BindToProperty(MenuItem.IsCheckedProperty, this, "IsWindowActivationEventOutputEnabled", BindingMode.TwoWay);
                    e.Menu.Items.Add(menuItem);

                    menuItem = new MenuItem()
                    {
                        Header = "Registration Events", IsCheckable = true
                    };
                    menuItem.BindToProperty(MenuItem.IsCheckedProperty, this, "IsWindowRegistrationEventOutputEnabled", BindingMode.TwoWay);
                    e.Menu.Items.Add(menuItem);
                }
            }

            this.AppendMessage(sb.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Occurs when a docking-related context menu is opening, allowing for customization before it is displayed.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">The <c>DockingMenuEventArgs</c> that contains data related to this event.</param>
        private void OnDockSiteMenuOpening(object sender, DockingMenuEventArgs e)
        {
            var sb = new StringBuilder(String.Format("WindowContextMenu: Kind={0}", e.Kind));

            if (e.Window != null)
            {
                sb.AppendFormat(", Title={0} ", e.Window.Title);

                if (e.Window == customizedDocumentWindow)
                {
                    e.Menu.Items.Add(new Separator());

                    var menuItem = new MenuItem()
                    {
                        Header = "Custom Menu Item Added at " + DateTime.Now.ToShortTimeString()
                    };
                    e.Menu.Items.Add(menuItem);
                }
                else if (e.Window == customizedToolWindow)
                {
                    e.Menu.Items.Clear();

                    var menuItem = new MenuItem()
                    {
                        Header = "Custom Menu Item Added at " + DateTime.Now.ToShortTimeString()
                    };
                    e.Menu.Items.Add(menuItem);
                }
            }

            this.AppendMessage(sb.ToString());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Occurs when the <c>TitleBarContextMenuOpening</c> event occurs.
 /// </summary>
 /// <param name="sender">The sender of the event.</param>
 /// <param name="e">The <see cref="DockingMenuEventArgs"/> that contains the event data.</param>
 private void OnWindowTitleBarMenuOpening(object sender, DockingMenuEventArgs e)
 {
     this.AppendMessage("TitleBarMenuOpening");
 }