예제 #1
0
        public WizardWindow(WizardBase wizard)
        {
            InitializeComponent();
            mWizard = wizard;
            wizard.mWizardWindow = this;

            this.Title = wizard.Title;

            // UpdateFinishButton();
            //xFinishButton.IsEnabled = false;

            SetterBaseCollection SBC = NavigationList.ItemContainerStyle.Setters;

            ((System.Windows.Setter)SBC[0]).Value = true;

            WizardEventArgs WizardEventArgs = new WizardEventArgs(mWizard, EventType.Init);

            foreach (WizardPage page in mWizard.Pages)
            {
                // send init event
                ((IWizardPage)page.Page).WizardEvent(WizardEventArgs);

                // TODO: attach validation error handler
                ((Page)page.Page).AddHandler(Validation.ErrorEvent, new RoutedEventHandler(ValidationErrorHandler));
            }

            RefreshCurrentPage();
            NavigationList.ItemsSource = mWizard.Pages;

            CurrentWizardWindow = this;
        }
예제 #2
0
        public static void ShowWizard(WizardBase wizard, double width = 800)
        {
            WizardWindow wizardWindow = new WizardWindow(wizard);

            wizardWindow.Width = width;
            wizardWindow.ShowDialog();
        }
예제 #3
0
        public static void ShowWizard(WizardBase wizard, double width = 800, double height = 800, bool DoNotShowAsDialog = false)
        {
            WizardWindow wizardWindow = new WizardWindow(wizard);

            wizardWindow.Dispatcher.Invoke(() =>
            {
                wizardWindow.Width  = width;
                wizardWindow.Height = height;
                if (!wizard.IsNavigationListEnabled)
                {
                    SetterBaseCollection sbc = wizardWindow.NavigationList.ItemContainerStyle.Setters;
                    sbc.Add(new Setter(ListBoxItem.IsEnabledProperty, wizard.IsNavigationListEnabled));
                    ((System.Windows.Setter)sbc[sbc.Count - 1]).Value = wizard.IsNavigationListEnabled;
                }
                if (DoNotShowAsDialog)
                {
                    wizardWindow.Owner = App.MainWindow;//adding owner so it will come on top
                    wizardWindow.Show();
                }
                else
                {
                    wizardWindow.ShowDialog();
                }
            });
        }
예제 #4
0
        public static void ShowWizard(WizardBase wizard, double width = 800, bool DoNotShowAsDialog = false)
        {
            WizardWindow wizardWindow = new WizardWindow(wizard);

            wizardWindow.Width = width;

            if (DoNotShowAsDialog)
            {
                wizardWindow.Owner = App.MainWindow;//adding owner so it will come on top
                wizardWindow.Show();
            }
            else
            {
                wizardWindow.ShowDialog();
            }
        }
예제 #5
0
        public static void ShowWizard(WizardBase wizard, double width = 800, bool DoNotShowAsDialog = false)
        {
            WizardWindow wizardWindow = new WizardWindow(wizard);

            wizardWindow.Width = width;

            if (DoNotShowAsDialog)
            {
                wizardWindow.Topmost = true;
                wizardWindow.Show();
            }
            else
            {
                wizardWindow.ShowDialog();
            }
        }
예제 #6
0
        // public static bool IgnoreDefaultNextButtonSettings { get; set; }
        // public static bool IgnoreDefaultPrevButtonSettings { get; set; }

        // when calling Validation for each page in case of errors the errors are added here.
        //public List<string> Errors = new List<string>();

        public WizardEventArgs(WizardBase Wizard, EventType EventType)
        {
            mWizard    = Wizard;
            mEventType = EventType;
        }