public static PieceView FromPath(string path) { PieceView pieceView = new PieceView(); pieceView.SetImagePath(path); return(pieceView); }
/// <summary> /// Updates a square with a piece view representation /// </summary> /// <param name="square">Square model</param> /// <param name="viewIndex">index in boardsquares view</param> private void UpdateSquarePiece(Square square, int viewIndex) { Piece piece = square.Piece; string imgPath = GetImagePathFromPiece(piece); PieceView pieceView = PieceView.FromPath(imgPath); BoardView.Squares[viewIndex].SetPieceView(pieceView); }
public SquareView() { Background = Brushes.White; PieceView = new PieceView(); BorderBrush = Brushes.Black; BorderThickness = new Thickness(3); // default color, but should never be visible unless something didn't setup correctly SquareColor = Brushes.Magenta; }
public void SetPieceView(PieceView pieceView) { Content = pieceView; }