예제 #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            MainWindow window = new MainWindow();

            // Create the ViewModel to which
            // the main window binds.

            var viewModel = new MainWindowViewModel();

            // When the ViewModel asks to be closed,
            // close the window.
            EventHandler handler = null;
            handler = delegate
            {
                viewModel.RequestClose -= handler;
                window.Close();
            };
            viewModel.RequestClose += handler;

            // Allow all controls in the window to
            // bind to the ViewModel by setting the
            // DataContext, which propagates down
            // the element tree.
            window.DataContext = viewModel;

            window.Show();
        }
예제 #2
0
 private void HelpExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
 {
     MainWindow.OpenUserGuide();
 }