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.
52 lines
1.1 KiB
52 lines
1.1 KiB
using System;
|
|
using System.Reflection.PortableExecutable;
|
|
using System.Xml.Linq;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using Model;
|
|
|
|
namespace ViewModels
|
|
{
|
|
[ObservableObject]
|
|
public partial class EditableSkinVM
|
|
{
|
|
public EditableSkinVM(ChampionVM championVM)
|
|
{
|
|
champion = championVM.Model;
|
|
}
|
|
|
|
public EditableSkinVM(SkinVM skinVM)
|
|
{
|
|
Name = skinVM.Name;
|
|
IconBase64 = skinVM.Icon;
|
|
LargeImageBase64 = skinVM.Image;
|
|
Description = skinVM.Description;
|
|
Price = skinVM.Price;
|
|
champion = skinVM.Champion;
|
|
}
|
|
|
|
[ObservableProperty]
|
|
private string name;
|
|
|
|
[ObservableProperty]
|
|
private string iconBase64;
|
|
|
|
[ObservableProperty]
|
|
private string largeImageBase64;
|
|
|
|
[ObservableProperty]
|
|
private string description;
|
|
|
|
[ObservableProperty]
|
|
private float price;
|
|
|
|
private Champion champion;
|
|
|
|
public SkinVM ToSkinVM()
|
|
{
|
|
var skin = new Skin(name, champion, price, iconBase64, largeImageBase64, description);
|
|
return new SkinVM(skin);
|
|
}
|
|
}
|
|
}
|
|
|