Exemplo n.º 1
0
        void ViewBind(ChickenPlaneView view)
        {
            BindingSet <ChickenPlaneView, ChickenPlaneViewModel> bindingSet =
                view.CreateBindingSet <ChickenPlaneView, ChickenPlaneViewModel>();

            bindingSet.Bind(view.CurCount).For(v => v.text).To(vm => vm.CurCount).OneWay();
            bindingSet.Bind(view.TotalCount).For(v => v.text).To(vm => vm.TotalCount).OneWay();

            bindingSet.Build();
        }
Exemplo n.º 2
0
        public void CreateBinding(GameObject obj)
        {
            _viewGameObject = obj;
            _viewCanvas     = _viewGameObject.GetComponent <Canvas>();

            bool bFirst = false;
            var  view   = obj.GetComponent <ChickenPlaneView>();

            if (view == null)
            {
                bFirst = true;
                view   = obj.AddComponent <ChickenPlaneView>();
                view.FillField();
            }
            DataInit(view);
            SpriteReset();
            view.BindingContext().DataContext = this;
            if (bFirst)
            {
                SaveOriData(view);
                ViewBind(view);
            }
            _view = view;
        }
Exemplo n.º 3
0
 void SaveOriData(ChickenPlaneView view)
 {
     view.oriCurCount   = _curCount;
     view.oriTotalCount = _totalCount;
 }
Exemplo n.º 4
0
 void DataInit(ChickenPlaneView view)
 {
     _curCount   = view.CurCount.text;
     _totalCount = view.TotalCount.text;
 }
Exemplo n.º 5
0
 private void EventTriggerBind(ChickenPlaneView view)
 {
 }