Exemplo n.º 1
0
        private void UserControl_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                if (Parent != null)
                {
                    (Parent as StackPanel).Children.Remove(this);
                    caption_MouseLeave(this, null);

                    try
                    {
                        WorkPage.RestoreModuleFromShortcut(new HistoryShortcut
                        {
                            Caption                = Caption,
                            Shortcut               = Shortcut,
                            ActionAfterRestore     = ActionAfterRestore,
                            ConstructorParams      = ConstructorParams,
                            DataContextParam       = DataContextParam,
                            ModuleType             = ModuleType,
                            ModuleDrawingBrushName = ModuleDrawingBrushName,
                        });
                    }
                    catch (Exception ex)
                    {
                        Manager.UI.ShowMessage(ex.Message);
                    }

                    //Manager.UI.AddTab(Caption, Frame as FrameworkElement);
                }
            }
            else
            {
                LastClicked = this;
            }
        }
Exemplo n.º 2
0
 void Header_PreviewMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (TabHeader.LastClosed != null)
     {
         var             history = (WorkPage.CurrentPage as WorkPage).HistoryContent as StackPanel;
         HistoryShortcut founded = null;
         foreach (HistoryShortcut hs in history.Children)
         {
             if (hs.Frame == TabHeader.LastClosed)
             {
                 founded = hs;
                 break;
             }
         }
         if (founded != null)
         {
             HistoryShortcut.LastClicked = founded;
             (WorkPage.CurrentPage as WorkPage).del_Click(null, null);
             TabHeader.LastClosed = null;
         }
     }
 }
Exemplo n.º 3
0
 public HistoryShortcut()
 {
     InitializeComponent();
     HistoryShortcut.HistoryContextMenu(this, new DependencyPropertyChangedEventArgs(ShowHistoryContextMenuProperty, ShowHistoryContextMenu, ShowHistoryContextMenu));
 }