示例#1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            Main_ViewModel mvm = DataContext as Main_ViewModel;

            if (mvm != null)
            {
                mvm.ExecuteOnLoad();
            }
        }
示例#2
0
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            base.OnClosing(e);

            Main_ViewModel mainViewModel = DataContext as Main_ViewModel;

            if (mainViewModel != null && mainViewModel.IsRestartRequested == true)
            {
                System.Windows.Forms.Application.Restart();
            }
        }
示例#3
0
        public MainWindow()
        {
            InitializeComponent();

            DB_ModelContainer db = new DB_ModelContainer();

            db.Database.Migrate();

            mainViewModel = new Main_ViewModel();
            DataContext   = mainViewModel;

            Workspace_ViewModel.SetFullScreen_Event += VmFullScreen_SetFullScreen_Event;
        }