Beispiel #1
0
        public void BindViewList <TItemVm, TItemView>
            (ObservableList <TItemVm> list, Transform root) where TItemVm : ViewModel
            where TItemView : View
        {
            var bind = new BindViewList <TItemVm, TItemView>(list, root);

            Binds.Add(bind);
        }
Beispiel #2
0
        /// <summary>
        /// 用在热更的BindView
        /// </summary>
        public void BindViewList(ObservableList <ViewModelAdapter.Adapter> list, Transform root, Type view)
        {
            BindViewList <ViewModelAdapter.Adapter, ViewAdapter.Adapter> bind;

            if (CacheBinds.Count > 0)
            {
                bind = (BindViewList <ViewModelAdapter.Adapter, ViewAdapter.Adapter>)CacheBinds.Dequeue();
            }
            else
            {
                bind = new BindViewList <ViewModelAdapter.Adapter, ViewAdapter.Adapter>();
            }
            bind.SetViewType(view);
            bind.Reset(list, root);
            AddClearable(bind);
        }
Beispiel #3
0
        public void BindViewList <TItemVm, TItemView>
            (ObservableList <TItemVm> list, Transform root) where TItemVm : ViewModel
            where TItemView : View
        {
            BindViewList <TItemVm, TItemView> bind;

            if (CacheBinds.Count > 0)
            {
                bind = (BindViewList <TItemVm, TItemView>)CacheBinds.Dequeue();
            }
            else
            {
                bind = new BindViewList <TItemVm, TItemView>();
            }
            bind.Reset(list, root);
            AddClearable(bind);
        }
Beispiel #4
0
 public void BindViewList <TItemVm>
     (BindableList <TItemVm> list, params View[] views) where TItemVm : ViewModel
 {
     CanClearListeners.Add(list);
     var bindList = new BindViewList <TItemVm>(list, views);
 }