Ejemplo n.º 1
0
        public void Show()
        {
            _layoutPreview = new LayoutPreview
            {
                IsActualSize = true,
                Opacity      = 0.5,
            };

            ShowLayout();
            OpenMainWindow();
        }
Ejemplo n.º 2
0
        public void CloseEditor()
        {
            _editor        = null;
            _layoutPreview = new LayoutPreview
            {
                IsActualSize = true,
                Opacity      = 0.5,
            };

            CurrentLayoutWindow.Content = _layoutPreview;

            OpenMainWindow();
        }
Ejemplo n.º 3
0
        public void ShowLayoutPicker()
        {
            DataContext = null;

            _editor        = null;
            _layoutPreview = new LayoutPreview();
            _layoutPreview.IsActualSize = true;
            _layoutPreview.Opacity      = 0.5;
            Content = _layoutPreview;

            MainWindow window = new MainWindow();

            window.Owner = this;
            window.Show();
        }
Ejemplo n.º 4
0
        public void ShowLayoutPicker()
        {
            DataContext = null;

            _editor        = null;
            _layoutPreview = new LayoutPreview();
            _layoutPreview.IsActualSize = true;
            _layoutPreview.Opacity      = 0.5;
            Content = _layoutPreview;

            MainWindow window = new MainWindow();

            window.Owner         = this;
            window.ShowActivated = true;
            window.Topmost       = true;
            window.Show();

            // window is set to topmost to make sure it shows on top of PowerToys settings page
            // we can reset topmost flag now
            window.Topmost = false;
        }
Ejemplo n.º 5
0
        public void OpenEditor(LayoutModel model)
        {
            _layoutPreview = null;
            if (CurrentDataContext is GridLayoutModel)
            {
                _editor = new GridEditor();
            }
            else if (CurrentDataContext is CanvasLayoutModel)
            {
                _editor = new CanvasEditor();
            }

            CurrentLayoutWindow.Content = _editor;

            EditorWindow window;
            bool         isGrid = false;

            if (model is GridLayoutModel)
            {
                window = new GridEditorWindow();
                isGrid = true;
            }
            else
            {
                window = new CanvasEditorWindow();
            }

            window.Owner       = Monitors[App.Overlay.CurrentDesktop].Window;
            window.DataContext = model;
            window.Show();

            if (isGrid)
            {
                (window as GridEditorWindow).NameTextBox().Focus();
            }

            window.LeftWindowCommands  = null;
            window.RightWindowCommands = null;
        }