public override void OnBefore()
        {
            _current = ViewModel.MultiStepView.CurrentView.Value;

            var stepInfo = ActionContext.GetValue <StepInfo>();

            _nextStep = ViewModel.MultiStepView.GetNovaStep(stepInfo);
        }
Exemple #2
0
        /// <summary>
        /// Creates a page specifically for the content zone and fills in the session model.
        /// </summary>
        /// <typeparam name="TView">The type of the view.</typeparam>
        /// <typeparam name="TViewModel">The type of the view model.</typeparam>
        /// <param name="novaStep">The nova step.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">parent</exception>
        /// <exception cref="System.NotSupportedException"></exception>
        internal TView CreateStep <TView, TViewModel>(NovaStep novaStep)
            where TView : class, IView, new()
            where TViewModel : ContentViewModel <TView, TViewModel>, new()
        {
            if (!Dispatcher.CheckAccess())
            {
                return(Dispatcher.Invoke(() => CreateStep <TView, TViewModel>(novaStep), DispatcherPriority.Send));
            }

            var view = _sessionViewModel.CreateView <TView, TViewModel>(this, false);

            var nodeId = novaStep.NodeId;
            var node   = _steps.First;

            while (node != null)
            {
                if (node.Value.NodeId == nodeId)
                {
                    break;
                }

                node = node.Next;
            }

            var initializer = new Dictionary <string, object>
            {
                { "Session", _sessionViewModel },
                { "Node", node },
                { "Model", _model }
            };

            var wizard = _parent as WizardView;

            if (wizard != null)
            {
                initializer.Add("Wizard", wizard.ViewModel);
            }

            ((ContentViewModel <TView, TViewModel>)view.ViewModel).Initialize(initializer);

            return(view);
        }
Exemple #3
0
 public LinkedListNode <StepInfo> GetStepInfoNode(NovaStep current)
 {
     return(GetStepInfoNode(current.NodeId));
 }