void ViewBind(CommonKillMessageView view) { BindingSet <CommonKillMessageView, CommonKillMessageViewModel> bindingSet = view.CreateBindingSet <CommonKillMessageView, CommonKillMessageViewModel>(); bindingSet.Bind(view.Show).For(v => v.activeSelf).To(vm => vm.Show).OneWay(); bindingSet.Build(); }
public void CreateBinding(GameObject obj) { _viewGameObject = obj; _viewCanvas = _viewGameObject.GetComponent <Canvas>(); bool bFirst = false; var view = obj.GetComponent <CommonKillMessageView>(); if (view == null) { bFirst = true; view = obj.AddComponent <CommonKillMessageView>(); view.FillField(); } DataInit(view); SpriteReset(); view.BindingContext().DataContext = this; if (bFirst) { SaveOriData(view); ViewBind(view); } _view = view; }
void SaveOriData(CommonKillMessageView view) { view.oriShow = _show; }
void DataInit(CommonKillMessageView view) { _show = view.Show.activeSelf; }
private void EventTriggerBind(CommonKillMessageView view) { }