Esempio n. 1
0
 private void AppStartup(object sender, StartupEventArgs args)
 {
     var mainWindow = new MainWindow {
         DataContext = new MainWindowViewModel()
     };
     mainWindow.Show();
 }
Esempio n. 2
0
 private void AppStartup(object sender, StartupEventArgs args)
 {
     //Waiting for the settings to be loaded
     Thread.Sleep(1000);
     var mainWindow = new MainWindow
     {
         DataContext = new MainWindowViewModel()
     };
     mainWindow.Show();
 }
Esempio n. 3
0
 private void AppStartup(object sender, StartupEventArgs args)
 {
     if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
     {
         MessageBox.Show(AppDomain.CurrentDomain.FriendlyName + " is already running. Application will now close.", "Application running!", MessageBoxButton.OK, MessageBoxImage.Stop);
         Application.Current.Shutdown();
     }
     else
     {
         //Waiting for the settings to be loaded
         Thread.Sleep(1000);
         var mainWindow = new MainWindow
         {
             DataContext = new MainWindowViewModel()
         };
         mainWindow.Show();
     }
 }