public MovementFigureViewModel(MovementListViewModel movementListViewModel, MovementFigureModel movement, int movementIndex, int variationIndex)
 {
     // Inicializa las propiedades
     MovementListViewModel = movementListViewModel;
     VariationIndex        = variationIndex;
     Selected      = false;
     Piece         = movement.OriginPiece;
     Color         = movement.Color;
     MovementIndex = movementIndex;
     Movement      = movement;
     Text          = movement.Content;
     HasVariation  = movement.Variations.Count > 0;
     Time          = "01:07";
     // Añade las variaciones
     VariationsList = new MovementListSelectVariationViewModel(movement);
     // Añade los comentarios
     Remarks = new ObservableCollection <MovementRemarkViewModel>();
     foreach (string comment in movement.Comments)
     {
         Remarks.Add(new MovementRemarkViewModel(comment));
         RemarksText += comment + Environment.NewLine;
     }
     HasRemarks = Remarks.Count > 0;
     // Inicializa la forma en que se debe ver el movimiento en la lista (tamaños de fuente, tamaños de imagen...)
     AssignViewSizes(variationIndex);
     // Inicializa los comandos
     SelectMovementCommand = new Mvvm.BaseCommand(parameter => ExecuteMovement(), parameter => CanExecuteMovement());
 }
 public MovementSelectVariationViewModel(GameBoardViewModel gameBoardViewModel, MovementVariationModel variation, MovementFigureModel movement)
 {
     // Inicializa los objetos
     GameBoardViewModel = gameBoardViewModel;
     Movement           = movement;
     Variation          = variation;
     // Inicializa las propiedades
     Piece = movement.OriginPiece;
     Color = movement.Color;
     Text  = movement.Content;
     // Inicializa los comandos
     SelectMovementCommand = new Mvvm.BaseCommand(parameter => ExecuteMovement(), parameter => CanExecuteMovement());
 }
Exemplo n.º 3
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());
 }
Exemplo n.º 4
0
 public GameBoardViewModel(MainViewModel mainViewModel)
 {
     // Inicializa los objetos
     MainViewModel = mainViewModel;
     Scapes        = new Scapes.ScapesBoardViewModel(this);
     MovementsList = new MovementListViewModel(this);
     // Inicializa los comandos
     NextMovementCommand = new Mvvm.BaseCommand(parameter => GoNextMovement(),
                                                parameter => CanGoMovement(true))
                           .AddListener(this, nameof(ActualMovementIndex))
                           .AddListener(this, nameof(IsMoving))
                           .AddListener(this, nameof(IsAtVariation));
     PreviousMovementCommand = new Mvvm.BaseCommand(parameter => GoPreviousMovement(),
                                                    parameter => CanGoMovement(false))
                               .AddListener(this, nameof(ActualMovementIndex))
                               .AddListener(this, nameof(IsMoving))
                               .AddListener(this, nameof(IsAtVariation));
     VariationExitCommand = new Mvvm.BaseCommand(parameter => ExitVariation(),
                                                 parameter => CanExitVariation())
                            .AddListener(this, nameof(ActualMovementIndex))
                            .AddListener(this, nameof(IsMoving))
                            .AddListener(this, nameof(IsAtVariation));
 }