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

27 lines
974 B
C#

using System;
using uMVVM.Sources.Infrastructure;
using UnityEngine;
namespace Game.MVVM.Model
{
public class MallStoreItemViewModel : 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<object> ItemData = new BindableProperty<object>();
public Action<bool ,string, GameObject> OnClickTog;
public void InitData(MallStoreItem item)
{
this.ItemId.Value = item.id;
this.ItemName.Value = item.name;
this.ItemIcon.Value = item.icon;
this.ItemDesc.Value = item.desc;
this.ItemData.Value = item.data;
}
}
}