Beispiel #1
0
 public MainViewModel(Mvvm.Controllers.IHostController hostController)
 {
     // Inicializa los objetos estáticos
     HostController = hostController;
     // Inicializa los objetos
     ComboPathBoard      = new PathComboImagesViewModel();
     ComboPathPieces     = new PathComboImagesViewModel();
     GameBoardViewModel  = new Board.GameBoardViewModel(this);
     PgnLibraryViewModel = new Pgn.PgnLibraryViewModel(GameBoardViewModel);
     // Inicializa las propiedades
     MustShowAnimation = true;
     // Inicializa los comandos
     LoadCommand = new Mvvm.BaseCommand(parameter => LoadFile());
 }
 public PgnGameInfoViewModel(PgnLibraryViewModel 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;
     Date        = game.Date;
     Title       = $"{Event}/{Round}: {WhitePlayer} - {BlackPlayer}";
     // Carga la información adicional
     InformationList = new PgnGameInfoTagListViewModel(this);
 }