protected virtual void AddPage(IWizardPageViewModel page)
 {
     if (page == null)
     {
         throw new ArgumentNullException(nameof(page));
     }
     _pages.Add(page);
 }
Ejemplo n.º 2
0
        private void ApplyBindings(WizardPage page, IWizardPageViewModel pageViewModel)
        {
            if (pageViewModel == null)
            {
                return;
            }

            SetPagePropertyBinding(page, WizardPage.HeaderProperty, HeaderBinding);
            SetPagePropertyBinding(page, Wizard97.SubtitleProperty, SubtitleBinding);
            SetPagePropertyBinding(page, Wizard97.IconProperty, IconBinding);
            SetPagePropertyBinding(page, WizardPage.IsFinishPageProperty, IsFinishPageBinding);
            SetPagePropertyBinding(page, WizardPage.AllowBackProperty, AllowBackBinding);
            SetPagePropertyBinding(page, WizardPage.AllowCancelProperty, AllowCancelBinding);
            SetPagePropertyBinding(page, WizardPage.AllowFinishProperty, AllowFinishBinding);
            SetPagePropertyBinding(page, WizardPage.AllowNextProperty, AllowNextBinding);
            SetPagePropertyBinding(page, WizardPage.ShowBackProperty, ShowBackBinding);
            SetPagePropertyBinding(page, WizardPage.ShowCancelProperty, ShowCancelBinding);
            SetPagePropertyBinding(page, WizardPage.ShowNextProperty, ShowNextBinding);

            SetPageBehaviorPropertyBinding(page, WizardPageMvvmBehavior.InitializeCommandProperty, InitializeCommandBinding);
            SetPageBehaviorPropertyBinding(page, WizardPageMvvmBehavior.CommitCommandProperty, CommitCommandBinding);
            SetPageBehaviorPropertyBinding(page, WizardPageMvvmBehavior.RollbackCommandProperty, RollbackCommandBinding);
            SetPageBehaviorPropertyBinding(page, WizardPageMvvmBehavior.NextPageProperty, NextPageBinding);
        }
Ejemplo n.º 3
0
 private void BindPageBehavior(WizardPageMvvmBehavior behavior, DependencyProperty property, IWizardPageViewModel source)
 {
     BindingOperations.SetBinding(behavior, property, new Binding(property.Name)
     {
         Source = source, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
     });
 }
Ejemplo n.º 4
0
 private void BindDefaultViewModel(WizardPage page, DependencyProperty property, IWizardPageViewModel source)
 {
     page.SetBinding(property, new Binding(property.Name)
     {
         Source = source, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
     });
 }
 public int GetPageIndex(IWizardPageViewModel vm)
 {
     return(_pages.IndexOf(vm));
 }