Exemplo n.º 1
0
 public static Task SimpleCollectionLoad <T>(this CollectionViewModel <T> viewModel, GitHubRequest <List <T> > request, bool forceDataRefresh) where T : new()
 {
     return(viewModel.RequestModel(request, forceDataRefresh, response =>
     {
         viewModel.CreateMore(response, m => viewModel.MoreItems = m, viewModel.Items.AddRange);
         viewModel.Items.Reset(response.Data);
     }));
 }
Exemplo n.º 2
0
        public static Task SimpleCollectionLoad <T>(this CollectionViewModel <T> viewModel, GitHubRequest <List <T> > request, bool forceDataRefresh) where T : new()
        {
            var weakVm = new WeakReference <CollectionViewModel <T> >(viewModel);

            return(viewModel.RequestModel(request, forceDataRefresh, response =>
            {
                weakVm.Get()?.CreateMore(response, m => {
                    var weak = weakVm.Get();
                    if (weak != null)
                    {
                        weak.MoreItems = m;
                    }
                }, viewModel.Items.AddRange);
                weakVm.Get()?.Items.Reset(response.Data);
            }));
        }
Exemplo n.º 3
0
 public DeferHelper(CollectionViewModel <TItem> parent)
 {
     _parent = parent;
 }