You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DataBinding]publicpartialclassPlayerViewModel:ViewModel{// Data Binding[DataBinding]publicstringName{get;set;}[DataBinding]publicintLevel{get;set;}[DataBinding]publicintExp{get;set;}[DataBinding]publicintCoin{get;set;}[DataBinding]publicstringPassword{get;set;}// Related Binding with single property[DataBindingRelated("Name")]publicstringNameRelatedTest1=>this.Name+"_RelatedTest1";// Related Binding with multiple properties[DataBindingRelated("Level, Exp")]publicstringLevelRelatedTest1=>(this.Level+this.Exp).ToString();// List Binding[DataBinding]publicList<PlayerTestItem>TestList{get;set;}}publicclassPlayerViewController:ViewController{[ViewModelKey("Test1")]publicPlayerViewModelTest1;[ViewModelKey("Test2")]publicPlayerViewModelTest2;protectedoverrideasyncUniTaskOnOpen(){awaitbase.OnOpen();this.Test1.Name="Test444.";this.Test1.Level=100;this.Test1.Exp=200;this.Test1.Coin=300;varrPlayerTestItems=newList<PlayerTestItem>();for(inti=0;i<100;i++){varrPlayerTestItem=newPlayerTestItem();rPlayerTestItem.Test1=$"Test1-{i}";rPlayerTestItem.Test2=$"Test2-{i}";rPlayerTestItems.Add(rPlayerTestItem);}this.Test1.TestList=rPlayerTestItems;}protectedoverridevoidOnClose(){}[DataBindingEvent(false)]publicvoidOnBtnEnter_Clicked(){this.Test1.TestList[4].Test1=this.Test1.Name;this.Test1.Exp=400;LogManager.LogError($"OnBtnEnter_Clicked Test..{this.Test2.Password}, {this.Test1.Name}");ViewManager.Instance.Close(this.View.GUID);HotfixBattle.Instance.Initialize().WrapErrors();}[DataBindingEvent(true)]publicvoidOnListBtnComfirmClicked(intnIndex){LogManager.LogError($"OnListButton_Clicked Test..{nIndex}, {this.Test1.TestList[nIndex].Test1}");}}