框架上传
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
namespace Stary.Evo.Example.Counter
|
||||
{
|
||||
|
||||
public interface ICounterData : IData
|
||||
{
|
||||
BindableProperty<int> Count { get; }
|
||||
}
|
||||
|
||||
public class CounterData : AbstractData, ICounterData
|
||||
{
|
||||
public override void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
var storage = this.GetUtility<IStorage>();
|
||||
Count.Value = storage.LoadInt("COUNTER_COUNT", 0);
|
||||
|
||||
Count.Register( count => { storage.SaveInt("COUNTER_COUNT", count); });
|
||||
}
|
||||
|
||||
public BindableProperty<int> Count { get; } = new BindableProperty<int>()
|
||||
{
|
||||
Value = 0
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user