/// <summary>
        /// HookEvents hooks into the events of the WizardPage to
        /// allow some background processing to occur.
        /// </summary>
        /// <param name="view">The WizardPage to hook events</param>
        public void HookEvents(PageInstalledHardwareView view)
        {
            //Save the view in the member variable -- this
            //is required to set focus at the end of the
            //multi-threading part
            this._view = view;

            //Hook the events
            view.Selected += new System.Windows.RoutedEventHandler(view_Selected);
        }
Exemplo n.º 2
0
        /// <summary>
        /// CreateWizardPages instantiates all of the Wizard Pages
        /// and hooks them up to the respective ViewModels.
        /// </summary>
        private void CreateWizardPages()
        {
            //Create a List to hold the Pages
            List <WizardPage> pages = new List <WizardPage>();

            //Create the Welcome Page
            PageWelcomeViewModel welcomeVM = this._unity.Resolve <PageWelcomeViewModel>();
            PageWelcomeView      welcomeV  = this._unity.Resolve <PageWelcomeView>();

            welcomeVM.Config     = this._config;
            welcomeV.DataContext = welcomeVM;
            pages.Add(welcomeV);

            //Create the Installed Hardware Page
            PageInstalledHardwareViewModel installedVM = this._unity.Resolve <PageInstalledHardwareViewModel>();
            PageInstalledHardwareView      installedV  = this._unity.Resolve <PageInstalledHardwareView>();

            installedVM.Config = this._config;
            installedVM.HookEvents(installedV);
            installedV.DataContext = installedVM;
            pages.Add(installedV);

            //Create the License Page
            PageLicenseViewModel licenseVM = this._unity.Resolve <PageLicenseViewModel>();
            PageLicenseView      licenseV  = this._unity.Resolve <PageLicenseView>();

            licenseVM.Config     = this._config;
            licenseV.DataContext = licenseVM;
            pages.Add(licenseV);

            //Create the Finish Page
            PageFinishViewModel finishVM = this._unity.Resolve <PageFinishViewModel>();
            PageFinishView      finishV  = this._unity.Resolve <PageFinishView>();

            finishVM.Config = this._config;
            finishVM.HookEvents(finishV);
            finishV.DataContext = finishVM;
            pages.Add(finishV);

            //Set the ItemsSource
            this.ItemsSource = pages;
        }