public MainViewModel() { PlatterViewModel = new PlatterViewModel(); //PlatterViewModel.Deserialize(@"D:\HE-ARC\DotNet\Projets\monopoly\classic.xml"); NewGameCommand = new RelayCommand(_param => New(), _param => true); QuitGameCommand = new RelayCommand(_param => Close()); }
protected override void New() { var configPlayers = new ConfigurationGameWindow { Owner = Application.Current.MainWindow }; configPlayers.ShowDialog(); if (!configPlayers.ConfigurationGameViewModel.IsCancelled) { var pathGame = configPlayers.ConfigurationGameViewModel.PathGame; PlatterViewModel.AddPlayers(new ObservableCollection <Player>(configPlayers.ConfigurationGameViewModel.Players)); PlatterViewModel.Deserialize(pathGame); } }