예제 #1
0
        private async void TreeView_LoadOnDemandEvent(object sender, LoadOnDemandEventArgs e)
        {
            if (e.Action == Action.RequestStatus)
            {
                e.HasChildNodes = (e.Node.Content as MusicInfo).HasChild;
            }

            else if (e.Action == Action.PopulateNodes)
            {
                var viewModel = new MusicInfoRepository();
                var node      = e.Node;
                if (node.ChildNodes.Count > 0)
                {
                    node.IsExpanded = true;
                    return;
                }

                node.ShowExpanderAnimation = true;
                await Task.Delay(2000);

                MusicInfo musicInfo = node.Content as MusicInfo;
                var       items     = viewModel.GetSubMenu(musicInfo.ID);
                node.PopulateChildNodes(items);
                if (items.Count() > 0)
                {
                    node.IsExpanded = true;
                }
                node.ShowExpanderAnimation = false;
            }
        }
 private void TAddressListNew_LoadOnDemand(object sender, LoadOnDemandEventArgs e)
 {
     if (!this.m_vmViewModel.AddNextDemandBatch(ref e))
     {
         this.TAddressListNew.LoadOnDemand -= TAddressListNew_LoadOnDemand;
     }
 }
예제 #3
0
        public bool AddNextDemandBatch(ref LoadOnDemandEventArgs e)
        {
            this.currentPage++;
            List <AddressBinding> lstAddressItemsSelector = GetAddressItemsSelector(this.currentPage, this.itemsPerPage);

            e.IsDataLoaded = true;

            if (lstAddressItemsSelector != null && lstAddressItemsSelector.Count > 0)
            {
                foreach (var objAddressItemsSelector in lstAddressItemsSelector)
                {
                    this.ModelAddressOList.Add(objAddressItemsSelector);
                }
                return(true);
            }
            return(false);
        }