Ejemplo n.º 1
0
 /// <summary>
 /// Show the window
 /// </summary>
 public void Show()
 {
     if (_cw.Dispatcher.CheckAccess())
     {
         _cw.Show();
     }
     else
     {
         _cw.Dispatcher.BeginInvoke(new Action(() => _cw.Show()));
     }
 }
 public VisualizerApp()
 {
     CalibratorWindow = new CalibratorWindow {
         Topmost = true
     };
     CalibratorWindow.Show();
     CalibratorWindow.Hide();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a WPF Application if needed
 /// </summary>
 protected VisualizerControl()
 {
     if (Application.Current == null)
     {
         //started form a non wpf Context
         _t = new Thread(() =>
         {
             _app = new VisualizerApp();
             _cw  = ((VisualizerApp)_app).CalibratorWindow;
             _app.ShutdownMode = ShutdownMode.OnExplicitShutdown;
             _app.Run();
         });
         _t.SetApartmentState(ApartmentState.STA);
         _t.Start();
     }
     else
     {
         //started form a WPF application
         _app = Application.Current;
         _cw  = new CalibratorWindow();
         _cw.Show();
         _cw.Hide();
     }
 }