private void DrawIcon(int x, int y, ChessPiece chessPiece) { var image = IconsProvider?.GetIcon(chessPiece); if (image != null) { image.Width = CellX; image.Height = CellY; CanvasRef.Children.Add(image); Canvas.SetLeft(image, x * CellX + NamedX); Canvas.SetTop(image, y * CellY + NamedY); Panel.SetZIndex(image, 1); image.MouseDown += OnIconMouseDown; image.Tag = new ChessPoint(x, y); } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return(IconsProvider.GetIcon((IconType)value)); }