/// <summary>
 /// Ctor
 /// </summary>
 /// <param name="wizardManager">The wizard manager</param>
 /// <param name="model">The keyboard to create or modify</param>
 public DeletionKeyboardListViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboardCollection model )
     : base(root, wizardManager, model)
 {
     HideNext = false;
     Title = R.KeyboardDeletionListStepTitle;
     Description = R.KeyboardDeletionListStepDesc;
 }
        /// <summary>
        /// Ctor, creates a new <see cref="SimpleKeyboardViewModel"/>.
        /// </summary>
        /// <param name="wizardManager">The wizard manager</param>
        public KeyboardProfileViewModel( IKeyboardEditorRoot root, WizardManager wizardManager )
            : base(root, wizardManager, false)
        {
            _viemModel = new SimpleKeyboardViewModel();
            _backupFileName = "";

            Title = R.KeyboardProfileTitle;
            Description = R.KeyboardProfileDesc;
        }
        public KeyboardEditionViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboard editedKeyboard )
            : base(root, wizardManager, false)
        {
            Root.EditedContext = new VMContextEditable( root, editedKeyboard, Root.Config, root.SkinConfiguration );
            Next = new SavingStepViewModel( Root, WizardManager, EditedContext.KeyboardVM.Model );

            Title = String.Format( R.KeyboardEditionStepTitle, editedKeyboard.Name );
            Description = R.KeyboardEditionStepDesc;
        }
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="wizardManager">The wizard manager</param>
        /// <param name="model">The keyboard to create or modify</param>
        public KeyboardProfileViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboard model )
            : base(root, wizardManager, false)
        {
            _model = model;
            _viemModel = new SimpleKeyboardViewModel( model );

            _backupFileName = Root.BackupKeyboard( model );

            Title = R.KeyboardProfileTitle;
            Description = R.KeyboardProfileDesc;
        }
        public KeyboardEditionViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboard editedKeyboard )
            : base(root, wizardManager, false)
        {
            Root.EditedContext = new VMContextEditable( root, editedKeyboard, Root.Config, root.SkinConfiguration );
            Next = new SavingStepViewModel( Root, WizardManager, EditedContext.KeyboardVM.Model );

            Title = String.Format( R.KeyboardEditionStepTitle, editedKeyboard.Name );
            Description = R.KeyboardEditionStepDesc;

            _autoSaveContextTimer = new DispatcherTimer( DispatcherPriority.Background );
            _autoSaveContextTimer.Interval = new TimeSpan( 0, 0, 30 );
        }
        public EndingStepViewModel( IKeyboardEditorRoot root, WizardManager wizardManager )
            : base(root, wizardManager, true)
        {
            Buttons = new List<WizardButtonViewModel>();
            HideNext = true;
            HideBack = true;

            Buttons.Add( new WizardButtonViewModel( R.Quit, R.EndingStepQuitDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/exit.png", CloseWizard ) );
            Buttons.Add( new WizardButtonViewModel( R.StartOver, R.EndingStepStartOverDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/restart.png", RestartWizard ) );

            Title = R.EndingStepTitle;
            Description = R.EndingStepDesc;
        }
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="root"></param>
        /// <param name="wizardManager"></param>
        /// <param name="keyboardCtx"></param>
        public HomeViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboardContext keyboardCtx )
            : base(root, wizardManager, false)
        {
            _keyboardCtx = keyboardCtx;
            Buttons = new List<WizardButtonViewModel>();

            Buttons.Add( new WizardButtonViewModel( R.HomeEditCurrentKeyboard, R.HomeEditCurrentKeyboardDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/edit-keyboard.png", EditCurrentKeyboard ) );
            Buttons.Add( new WizardButtonViewModel( R.HomeEditNewKeyboard, R.HomeEditNewKeyboardDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/create-keyboard.png", CreateNewKeyboard ) );
            Buttons.Add( new WizardButtonViewModel( R.HomeEditOtherKeyboard, R.HomeEditOtherKeyboardDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/edit-other-keyboard.png", EditOtherKeyboard ) );
            Buttons.Add( new WizardButtonViewModel( R.HomeDestroyKeyboardTitle, R.HomeDestroyKeyboardDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/destroy-keyboard.png", DestroyKeyboard ) );
            Title = R.HomeStepTitle;
            Description = R.HomeStepDescription;
            HideNext = true;
            HideBack = true;
        }
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="root">The ContextEditor that is the root of this wizard</param>
        /// <param name="wizardManager">The wizardManager</param>
        /// <param name="keyboard">The modified keyboard to save</param>
        public SavingStepViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboard keyboard )
            : base(root, wizardManager, false)
        {
            _keyboardToSave = keyboard;

            Buttons = new List<WizardButtonViewModel>();
            HideNext = true;
            Buttons.Add( new WizardButtonViewModel( R.SavingStepSaveTitle, R.SavingStepSaveDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/save-keyboard.png", SaveOnEditedKeyboard ) );
            Buttons.Add( new WizardButtonViewModel( R.SavingStepSaveAsTitle, R.SavingStepSaveAsDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/save-as.png", SaveUnderOtherKeyboard ) );
            Buttons.Add( new WizardButtonViewModel( R.SavingStepCancelAndQuitTitle, R.SavingStepCancelAndQuitDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/cancel-quit.png", CancelAndQuit ) );
            Buttons.Add( new WizardButtonViewModel( R.SavingStepCancelAndRestartTitle, R.SavingStepCancelAndRestartDesc, "pack://application:,,,/KeyboardEditor;component/Resources/Images/cancel-restart.png", CancelAndRestart ) );

            Title = R.SavingStepTitle;
            Description = String.Format( R.SavingStepDesc, keyboard.Name );
        }
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="wizardManager">The wizard manager</param>
        /// <param name="model">The keyboard to create or modify</param>
        public KeyboardListViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboardCollection model )
            : base(root, wizardManager, false)
        {
            _keyboards = model;
            KeyboardVms = new List<KeyboardViewModel>();
            foreach( var keyboard in _keyboards )
            {
                if(root.KeyboardContext.Service.CurrentKeyboard != keyboard)
                    KeyboardVms.Add( new KeyboardViewModel( keyboard ) );
            }

            HideNext = true;
            Title = R.KeyboardListStepTitle;
            Description = R.KeyboardListStepDesc;
        }
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="wizardManager">The wizard manager</param>
        /// <param name="model">The keyboard to save</param>
        public SaveAsStepViewModel( IKeyboardEditorRoot root, WizardManager wizardManager, IKeyboard editedKeyboard )
            : base(root, wizardManager, false)
        {
            _editedKeyboard = editedKeyboard;
            _keyboards = Root.KeyboardContext.Service.Keyboards.Except( Root.KeyboardContext.Service.Keyboards.Where( ( k ) => k.Name == editedKeyboard.Name ) );
            KeyboardVms = new List<KeyboardViewModel>();
            foreach( var keyboard in _keyboards )
            {
                KeyboardVms.Add( new KeyboardViewModel( keyboard ) );
            }

            Title = R.SaveAsStepTitle;
            Description = R.SaveAsStepDesc;

            Next = new EndingStepViewModel( root, wizardManager );
        }
 public HelpAwareWizardPage( IKeyboardEditorRoot root, WizardManager wizardManager, bool isLastStep, string title = "" )
     : this(root, wizardManager, null, isLastStep, title)
 {
 }
 public HelpAwareWizardPage( IKeyboardEditorRoot root, WizardManager wizardManager, WizardPage next, string title = "" )
     : this(root, wizardManager, next, false, title)
 {
 }
 public HelpAwareWizardPage( IKeyboardEditorRoot root, WizardManager wizardManager, WizardPage next, bool isLastStep, string title = "" )
     : base(wizardManager, next, title)
 {
     Root = root;
 }