public void RunApp() { var app = new App(); app.Run(); app.Shutdown(); }
static void Main() { App app = new App { ShutdownMode = ShutdownMode.OnExplicitShutdown }; app.InitializeComponent(); SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext()); Program4a p = new Program4a(); p.ExitRequested += (sender, e) => { app.Shutdown(); }; Task programStart = p.StartAsync(); app.Run(); }
/// <summary> /// <para>Instantiates the MainViewModel class</para> /// </summary> /// <param name="app"></param> public MasterViewModel(App app) { m_app = app; ExitCommand = new RelayCommand((o) => m_app.Shutdown(), (o) => true); }