public void LoadUserControl(ShadowProcessEditView view)
        {
            var processBases = iProcessBaseService.GetPagerProcessBase("", 1, 100);

            ProcessBases = new BindableCollection <ProcessBaseModel>(processBases);
            NotifyOfPropertyChange(() => ProcessBases);

            var shadowBases = iShadowBaseService.GetPagerShadowBase("", 1, 100);

            ShadowBases = new BindableCollection <ShadowBaseModel>(shadowBases);
            NotifyOfPropertyChange(() => ShadowBases);
        }
Exemple #2
0
 private void LoadData(string key, int pageIndex = 1, int pageSize = 10)
 {
     pbLoading.Visibility = Visibility.Visible;
     Task.Factory.StartNew(() =>
     {
         var list        = iShadowBaseService.GetPagerShadowBase(key, pageIndex, pageSize);
         var total       = iShadowBaseService.GetShadowBaseCount(key);
         var pageCount   = total / pageSize == 0 ? 1 : (total / pageSize) + (total % pageSize == 0 ? 0 : 1);
         ModelCollection = new BindableCollection <ShadowBaseModel>(list);
         PagerModel      = new PagerModel {
             TotalCount = total, PageCount = pageCount, DetailMsg = string.Format("[共{0}页/共{1}条]", pageCount, total)
         };
     }).ContinueWith((task) =>
     {
         System.Windows.Application.Current.Dispatcher.Invoke(new System.Action(() =>
         {
             pbLoading.Visibility = Visibility.Collapsed;
         }));
     });
 }