Frame/Assets/Scripts/UI/MVVM/ViewModel/MallScrollItemViewModel.cs

27 lines
1.1 KiB
C#

using System;
using uMVVM.Sources.Infrastructure;
namespace Game.MVVM.Model
{
public class MallScrollItemViewModel : ViewModelBase
{
public readonly BindableProperty<long> ItemId = new BindableProperty<long>();
public readonly BindableProperty<string> ItemName = new BindableProperty<string>();
public readonly BindableProperty<string> ItemIcon = new BindableProperty<string>();
public readonly BindableProperty<string> ItemDesc = new BindableProperty<string>();
public readonly BindableProperty<int> ItemCount = new BindableProperty<int>();
public readonly BindableProperty<object> ItemData = new BindableProperty<object>();
public Action<string, object> OnClickBuy;
public void InitData(MallScrollItem item)
{
this.ItemId.Value = item.id;
this.ItemName.Value = item.name;
this.ItemIcon.Value = item.icon;
this.ItemDesc.Value = item.desc;
this.ItemCount.Value = item.count;
this.ItemData.Value = item.data;
}
}
}