Example #1
0
        //private static KeyGesture[] ms_defaultShortcuts = new KeyGesture[]
        //{
        //    new KeyGesture(Key.NumPad0, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad1, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad2, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad3, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad4, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad5, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad6, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad7, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad8, ModifierKeys.Control),
        //    new KeyGesture(Key.NumPad9, ModifierKeys.Control),
        //};

        /// <summary>
        /// Show the 'save layout as' dialog</summary>
        /// <remarks>Programmatic method for showing the 'save layout as' dialog</remarks>
        public override void ShowSaveLayoutAsDialog()
        {
            var vm     = new WindowLayoutNewViewModel(WindowLayoutService.Layouts);
            var dialog = new WindowLayoutNewDialog(vm);

            if (dialog.ShowParentedDialog() != true)
            {
                return;
            }

            SaveLayoutAs(vm.LayoutName);

            // todo: Assign Shortcut
        }
        /// <summary>
        /// Show the 'save layout as' dialog</summary>
        /// <remarks>Programmatic method for showing the 'save layout as' dialog</remarks>
        public override void ShowSaveLayoutAsDialog()
        {
            using (var dialog = new WindowLayoutNewDialog())
            {
                // Allow user to save-as an existing item
                //// This will allow the dialog to check for duplicates
                //dialog.ExistingLayoutNames = WindowLayoutService.Layouts;

                TryUseMainFormIcon(MainForm, dialog);

                if (dialog.ShowDialog(MainForm) != DialogResult.OK)
                {
                    return;
                }

                SaveLayoutAs(dialog.LayoutName);
            }
        }