Exemplo n.º 1
0
 public GameViewModel(PgnGameViewModel chessGameViewModel, GameModel game)
 {
     // Asigna el juego
     TopViewModel = chessGameViewModel;
     Game         = game;
     // Carga los datos
     if (string.IsNullOrEmpty(game.Event))
     {
         Event = "Sin evento definido";
     }
     else
     {
         Event = game.Event;
     }
     Round       = game.Round;
     Site        = game.Site;
     WhitePlayer = game.WhitePlayer;
     BlackPlayer = game.BlackPlayer;
     if (game.Year != null && game.Month != null && game.Day != null)
     {
         Date = $"{game.Year}-{game.Month}-{game.Day}";
     }
     else if (game.Month != null && game.Day != null)
     {
         Date = $"{game.Month}-{game.Day}";
     }
     Title = $"{Event}/{Round}: {WhitePlayer} - {BlackPlayer}";
     // Carga la información adicional
     InformationList = new AdditionalInfo.AdditionalInfoListViewModel(this);
 }
 public GameBoardViewModel(PgnGameViewModel pgnGameViewModel)
 {
     PgnGameViewModel = pgnGameViewModel;
 }
Exemplo n.º 3
0
 public MainWindow()
 {
     InitializeComponent();
     ChessGameViewModel = new ViewModels.PgnGameViewModel(AppDomain.CurrentDomain.BaseDirectory);
     DataContext        = ChessGameViewModel;
 }