コード例 #1
0
        private void RunProgram()
        {
            var mW = new View.MainWindow()
            {
                DataContext = new ViewModel.MainWindowViewModel()
            };

            mW.Closing += MW_Closing;
            mW.Show();

            if (!ProjectStatistics.Properties.Settings.Default.LicenseAccepted)
            {
                mW.ShowLicenseWindow();
            }
        }
コード例 #2
0
 private void MW_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     View.MainWindow mW = sender as View.MainWindow;
     ViewModel.MainWindowViewModel dataContext = mW.DataContext as ViewModel.MainWindowViewModel;
     dataContext.CloseAllWindows();
 }