Esempio n. 1
0
        //public static Wizard WizardWindow;

        private void ShowWizardWindow()
        {
            if (_wizard_window == null)
            {
                _wizard_window = new Wizard();
            }
            else if (_wizard_window.Visibility == System.Windows.Visibility.Hidden)
            {
                _wizard_window = new Wizard();
            }
            else if (_wizard_window.Visibility == System.Windows.Visibility.Visible)
            {
                _wizard_window.Activate();
            }
            if (_wizard_window.WindowState == System.Windows.WindowState.Minimized)
            {
                _wizard_window.WindowState = System.Windows.WindowState.Normal;
            }

            _wizard_window.Visibility = System.Windows.Visibility.Visible;
            //if(Wizard.WindowsOpen != true)
            //{
            //    WizardWindow = Wizard.GetInstance;
            //    if(WizardWindow.ActualHeight != 0)
            //        WizardWindow.Activate();
            //    else
            //    {
            //        //WizardWindow.Show();
            //        //Thread thread = new Thread((ThreadStart)(() =>
            //        //{
            //        //    WizardWindow.Show();

            //        //    System.Windows.Threading.Dispatcher.Run();
            //        //}));

            //        //thread.SetApartmentState(ApartmentState.STA);
            //        //thread.Start();

            //        WizardWindow.Dispatcher.Invoke(DispatcherPriority.Normal,
            //            new Action(delegate ()
            //            {
            //                WizardWindow.Show();
            //            }
            //            ));
            //    }
            //}
            //else if(WizardWindow.WindowState == System.Windows.WindowState.Minimized)
            //    WizardWindow.WindowState = System.Windows.WindowState.Normal;
            //WizardWindow.Activate();
            //WizardWindow.Topmost = true;  // important
            //WizardWindow.Topmost = false; // important
            //WizardWindow.Focus();         // important
        }