private void AddRules_Click(object sender, RoutedEventArgs e) { var nrw = new NewRuleWindow(); nrw.Owner = Window.GetWindow(this); nrw.Show(); }
private void addRuleNextYear_Click(object sender, System.Windows.RoutedEventArgs e) { NewRuleWindow window = new NewRuleWindow(); window.ShowDialog(); if (window.ChosenRule != null) { var vm = SimpleIoc.Default.GetInstance <ChampionshipViewModel>(); if (vm.ChampionshipData != null) { vm.ChampionshipData.NextYearsRules.AddRule(window.ChosenRule); // refresh view model vm.SetModel(vm.ChampionshipData); } } }