You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.6 KiB
69 lines
1.6 KiB
using System;
|
|
using System.ComponentModel;
|
|
using TheGameExtreme.model.card;
|
|
using SkiaSharp;
|
|
using System.Drawing;
|
|
using System.Drawing.Drawing2D;
|
|
|
|
namespace TheGameExtreme.viewmodel
|
|
{
|
|
public class CardVM : INotifyPropertyChanged
|
|
{
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
public Card View { get; set; }
|
|
protected string image;
|
|
|
|
public string Image
|
|
{
|
|
get { return image; }
|
|
set
|
|
{
|
|
image = value;
|
|
OnPropertyChanged("Image");
|
|
}
|
|
}
|
|
protected int value;
|
|
private Image bmp;
|
|
|
|
public int Value {
|
|
get { return value; }
|
|
set
|
|
{
|
|
this.value = value;
|
|
OnPropertyChanged("Value");
|
|
}
|
|
}
|
|
protected virtual void OnPropertyChanged(string info)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(info));
|
|
}
|
|
|
|
|
|
|
|
public CardVM(Card view)
|
|
{
|
|
View = view;
|
|
Value = view.Value;
|
|
|
|
/*SKBitmap bit = new SKBitmap();
|
|
RectangleF rectangle = new RectangleF(50, 90, 90, 50);
|
|
|
|
Graphics g = Graphics.FromImage(bmp);
|
|
|
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
|
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
|
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
|
g.DrawString("yourText", new Font("Tahoma", 8), Brushes.Black, rectangle);
|
|
|
|
g.Flush();*/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|