// Constructor public SpendingsHistoryVM(MainVM mainVM) { // Pass MVM to use as parent for child windows this.MVM = mainVM; // Link Buttons to Handlers this.ImportSpendingsCommand = new CommandHandler(ImportSpendingsButton_Click); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var mainWindow = new MainView(); var mvm = new MainVM(mainWindow); mainWindow.DataContext = mvm; mainWindow.Show(); }