Example #1
0
        private void AddRules_Click(object sender, RoutedEventArgs e)
        {
            var nrw = new NewRuleWindow();

            nrw.Owner = Window.GetWindow(this);
            nrw.Show();
        }
Example #2
0
        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);
                }
            }
        }