Esempio n. 1
0
        public static void Show(String text)
        {
            if (_splashActive == false)
            {
                _splashActive = true;
                Thread thread = new Thread(() =>
                {
                    WindowWait wndSplash  = new WindowWait();
                    wndSplash.DataContext = _model;
                    wndSplash.Title       = "Подождите пожалуйста";

                    Text    = text;
                    Percent = -1;

                    wndSplash.ShowDialog();

                    wndSplash.Closed += (sender1, e1) => wndSplash.Dispatcher.InvokeShutdown();
                    System.Windows.Threading.Dispatcher.Run();
                });
                thread.SetApartmentState(ApartmentState.STA);
                thread.IsBackground = true;
                thread.Start();

                // Пауза для отображения окна (если вызов был выполнен не из GUI-потока)
                Thread.Sleep(100);
            }
        }
Esempio n. 2
0
        public static void Show(String text)
        {
            if (_splashActive == false)
            {
                _splashActive = true;
                Thread thread = new Thread(() =>
                {
                    WindowWait wndSplash = new WindowWait();
                    wndSplash.DataContext = _model;
                    wndSplash.Title = "Подождите пожалуйста";

                    Text    = text;
                    Percent = -1;

                    wndSplash.ShowDialog();

                    wndSplash.Closed += (sender1, e1) => wndSplash.Dispatcher.InvokeShutdown();
                    System.Windows.Threading.Dispatcher.Run();
                });
                thread.SetApartmentState(ApartmentState.STA);
                thread.IsBackground = true;
                thread.Start();

                // Пауза для отображения окна (если вызов был выполнен не из GUI-потока)
                Thread.Sleep(100);
            }
        }