Exemple #1
0
        private void _ApplyMenu()
        {
            var ele = DataContext as DockElement;

            menu = new DockMenu(ele);
            menu.PlacementTarget = ctb;
            menu.Placement       = PlacementMode.Bottom;
            ctb.ContextMenu      = menu;
        }
        public void UpdateTemplate()
        {
            PropertyChanged(this, new PropertyChangedEventArgs("IsSingleMode"));
            PropertyChanged(this, new PropertyChangedEventArgs("NoBorder"));
            CommandManager.InvalidateRequerySuggested();

            if (menu != null)
            {
                menu.Dispose();
                menu = null;
            }
        }
        private void _ApplyMenu()
        {
            if (menu != null)
            {
                menu.Dispose();
                menu = null;
            }
            var ele = DataContext as DockElement;

            menu = new DockMenu(ele);
            menu.PlacementTarget = ctb;
            menu.Placement       = PlacementMode.Bottom;
            ctb.ContextMenu      = menu;
        }
Exemple #4
0
 protected override IntPtr FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
 {
     switch (msg)
     {
     case Win32Helper.WM_NCLBUTTONDOWN:
     case Win32Helper.WM_NCRBUTTONDOWN:
         ActiveSelf();
         if (IsSingleMode && msg == Win32Helper.WM_NCRBUTTONDOWN)
         {
             ContextMenu = new DockMenu((Child as BaseGroupControl).SelectedItem as IDockItem);
         }
         break;
     }
     return(base.FilterMessage(hwnd, msg, wParam, lParam, ref handled));
 }
Exemple #5
0
 protected override void OnContentChanged(object oldContent, object newContent)
 {
     base.OnContentChanged(oldContent, newContent);
     if (oldContent != null)
     {
         ContextMenu = null;
     }
     if (newContent is IDockItem)
     {
         if (_dockViewParent is AnchorSideGroupControl)
         {
             ContextMenu = new DockMenu(newContent as IDockItem);
         }
     }
     ToolTip = string.Empty;
 }
 protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
 {
     base.OnMouseRightButtonDown(e);
     ContextMenu = new DockMenu(DataContext as DockElement);
 }
 private void _ApplyMenu(IDockItem item)
 {
     menu           = new DockMenu(item);
     menu.Placement = PlacementMode.MousePoint;
 }