示例#1
0
        private void Desktop_Startup(object sender, ControlledApplicationLifetimeStartupEventArgs e)
        {
            MessageHandlers.RegisterMessageHandlers(this);

            AppViewModel.Initialize(e.Args);
            DataContext = AppVM;

            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
            {
                var window = new MainWindow
                {
                    VM = new MainViewModel()
                };
                desktop.MainWindow = window;
            }
        }
示例#2
0
 private void Desktop_Exit(object sender, ControlledApplicationLifetimeExitEventArgs e)
 {
     MessageHandlers.UnregisterMessageHandlers(this);
 }