Exemple #1
0
        private void UIElement_OnPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            MenuToggleButton.IsChecked = false;

            TournamentViewModel       selectedTournament = this.TournamentsListBox.SelectedItem as TournamentViewModel;
            EditRacesControlViewModel vm = _conductRacesWindow?.DataContext as EditRacesControlViewModel;

            vm?.Dispose();

            if (_conductRacesWindow != null)
            {
                vm = null;

                if (selectedTournament != null)
                {
                    vm = new EditRacesControlViewModel(selectedTournament.TournamentID);
                }

                _conductRacesWindow.DataContext = vm;
            }
        }
Exemple #2
0
        private void ConductRaces_Click(object sender, RoutedEventArgs e)
        {
            if (_conductRacesWindow != null)
            {
                if (_conductRacesWindow.IsLoaded)
                {
                    _conductRacesWindow.Close();
                }

                _conductRacesWindow = null;
            }

            TournamentViewModel vm = this.TournamentsListBox.SelectedItem as TournamentViewModel;

            _conductRacesWindow = new ConductRacesWindow
            {
                Owner       = this,
                DataContext = new EditRacesControlViewModel(vm.TournamentID)
            };

            _conductRacesWindow.Closed += ConductRacesWindows_Closed;

            _conductRacesWindow.Show();
        }
Exemple #3
0
        private void EditEvent_Click(object sender, RoutedEventArgs e)
        {
            TournamentViewModel vm = this.TournamentsListBox.SelectedItem as TournamentViewModel;

            vm?.EditTournament();
        }