public Menu(ref MenuViewModel viewModel) { InitializeComponent(); this.DataContext = viewModel; // assign the view model to the data context of the view. viewModel.AutomationCompletedEvent += ViewModel_AutomationCompletedEvent; // add an event handler for when the automation is completed. }
public static void run() { MenuViewModel VM = new MenuViewModel(); // create the view model container UI.Menu MW = new UI.Menu(ref VM); // create the view. MW.ShowDialog(); // display the program to the user. }