Beispiel #1
0
        private void ConductRacesWindows_Closed(object sender, EventArgs e)
        {
            if (_conductRacesWindow != null)
            {
                EditRacesControlViewModel vm = _conductRacesWindow.DataContext as EditRacesControlViewModel;
                vm?.Dispose();

                _conductRacesWindow.Closed -= ConductRacesWindows_Closed;
            }
        }
Beispiel #2
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;
            }
        }