Beispiel #1
0
        /// <summary>
        /// 用在热更的BindView
        /// </summary>
        public void BindViewList(ObservableList <ViewModelAdapter.Adapter> list, LoopScrollRect root, Type view)
        {
            BindLoopViewList <ViewModelAdapter.Adapter, ViewAdapter.Adapter> bind;

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

            if (CacheBinds.Count > 0)
            {
                bind = (BindLoopViewList <TItemVm, TItemView>)CacheBinds.Dequeue();
            }
            else
            {
                bind = new BindLoopViewList <TItemVm, TItemView>();
            }
            bind.Reset(list, root);
            AddClearable(bind);
        }