コード例 #1
0
 private void AppStartup(object sender, StartupEventArgs args)
 {
     var mainWindow = new MainWindow {
         DataContext = new MainWindowViewModel()
     };
     mainWindow.Show();
 }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: xquiaz/PogoLocationFeeder
 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();
 }
コード例 #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();
     }
 }