protected virtual void BackExecute(object o)
        {
            Assert.IsTrue(this.Steps.Count > 0, "Steps stack is corrupted. Can't be less than 1");
            var contentVMtoDestroy = this.ContentVM as IDisposable;

            if (contentVMtoDestroy != null)
            {
                contentVMtoDestroy.Dispose();
            }
            this.Steps.Pop();
            this.CanBack = this.Steps.Count > 1;
            if (this.CanBack)
            {
                WindowStepState windowStepState = this.Steps.Where((state, index) => index == 1).FirstOrDefault();
                if (windowStepState != null)
                {
                    this.BackToTitle = windowStepState.ShortName;
                }
                else
                {
                    this.BackToTitle = "hell :)";
                }
            }
            this.NotifyPublicVisibleChanged();
        }
 public static void GoAheadWithBackIfPossible(WindowStepState newState)
 {
     if (GoAheadTargets != null)
     {
         GoAheadTargets(newState);
     }
 }
 public virtual void ReplaceInitialState(WindowStepState newHomeState)
 {
     this.ClearStepsStackWithDisposing();
     this.Steps.Push(newHomeState);
     this.CanBack = false;
     this.NotifyPublicVisibleChanged();
 }
 protected virtual void GoAheadWithBack(WindowStepState newState)
 {
     Assert.IsNotNull(newState, "New state cannot be null");
     this.BackToTitleInternal = this.CurrentState.ShortName;
     this.Steps.Push(newState);
     this.CanBack = true;
     this.NotifyPublicVisibleChanged();
 }
Example #5
0
 static WindowStepState()
 {
     EmptyState = new WindowStepState();
       EmptyState.SuperAction =
     new ActionCommandVM(
       new RelayCommand(delegate { throw new InvalidOperationException("Command can't be executed!"); }, false),
       string.Empty);
       EmptyState.StateSpecificHelpActions = new List<ActionCommandVM>();
       EmptyState.ContentVM = DependencyProperty.UnsetValue;
 }
Example #6
0
 static WindowStepState()
 {
     EmptyState             = new WindowStepState();
     EmptyState.SuperAction =
         new ActionCommandVM(
             new RelayCommand(delegate { throw new InvalidOperationException("Command can't be executed!"); }, false),
             string.Empty);
     EmptyState.StateSpecificHelpActions = new List <ActionCommandVM>();
     EmptyState.ContentVM = DependencyProperty.UnsetValue;
 }
 protected virtual WindowStepState GetInitialStep(GetMainVMPipelineArgs args)
 {
     var step = new WindowStepState(
     this.GlobalTitle.GetValueOrDefault("Tray Garden -- Plants configuration"),
     this.Header.GetValueOrDefault("Here you configure plants"),
     this.ShortName.GetValueOrDefault("plants config"),
     args.PlantsConfigVM,
     args.SuperAction,
     args.StateSpecificHelpActions);
       return step;
 }
 protected virtual void ClearStepsStackWithDisposing()
 {
     while (this.Steps.Count > 0)
     {
         WindowStepState currentStep          = this.Steps.Pop();
         var             currentStepContentVM = currentStep.ContentVM as IDisposable;
         if (currentStepContentVM != null)
         {
             currentStepContentVM.Dispose();
         }
     }
 }
Example #9
0
 protected virtual void GoAheadWithBack(WindowStepState newState)
 {
     Assert.IsNotNull(newState, "New state cannot be null");
       this.BackToTitleInternal = this.CurrentState.ShortName;
       this.Steps.Push(newState);
       this.CanBack = true;
       this.NotifyPublicVisibleChanged();
 }
Example #10
0
 public virtual void ReplaceInitialState(WindowStepState newHomeState)
 {
     this.ClearStepsStackWithDisposing();
       this.Steps.Push(newHomeState);
       this.CanBack = false;
       this.NotifyPublicVisibleChanged();
 }
Example #11
0
 public static void GoAheadWithBackIfPossible(WindowStepState newState)
 {
     if (GoAheadTargets != null)
       {
     GoAheadTargets(newState);
       }
 }