public MainViewViewModel() { Log.Info("MainViewViewModel() starting"); DisplayName = "I am the Tennis Master!!!"; //base.DisplayName = Strings.MainWindowViewModel_DisplayName; //_customerRepository = new CustomerRepository(customerDataFile); //_activeViewModel = new MatchHistoryViewModel(); //ViewAllMatches(); //ViewPlayerCommand = new RelayCommand(param => ActiveViewModel = new PlayerViewModel()); //ViewAllPlayersCommand = new RelayCommand(param => ActiveViewModel = new PlayerListViewModel()); //ViewTennisEventCommand = new RelayCommand(param => ActiveViewModel = new TennisEventViewModel()); //ViewAllTennisEventsCommand = new RelayCommand(param => ActiveViewModel = new TennisEventListViewModel(), param => true); //ViewAllMatchesCommand = new RelayCommand(param => ViewAllMatches()); //ViewMatchCommand = new RelayCommand(param => ActiveViewModel = new MatchViewModel()); NewMatchCommand = new RelayCommand(param => ItemDetailViewModel = new MatchEditViewModel()); NewPlayerCommand = new RelayCommand(param => ItemDetailViewModel = new PlayerEditViewModel()); //NewEventCommand = new RelayCommand(param => ItemDetailViewModel = new TennisEventEditViewModel()); Log.Info("MainViewViewModel() creating MatchEditViewModel"); ItemDetailViewModel = new MatchEditViewModel(); Log.Info("MainViewViewModel() creating NewMatchHistoryViewModel"); MatchHistoryViewModel = NewMatchHistoryViewModel(); Log.Info("MainViewViewModel() creating NewOpponentSummaryViewModel"); SummaryViewModel = NewOpponentSummaryViewModel(); //MatchHistoryViewModel. EventManager.RegisterClassHandler(typeof(TextBox), TextBox.GotFocusEvent, new RoutedEventHandler(TextBox_GotFocus)); Log.Info("MainViewViewModel() done"); }
void MatchViewModel_EditRequested(Match item) { var vm = new MatchEditViewModel(item); vm.EditCompleted += new MatchEditViewModel.EditCompletedEventHandler(MatchViewModel_EditCompleted); ItemDetailViewModel = vm; }