Esempio n. 1
0
 public static Task SimpleCollectionLoad <T>(this CollectionViewModel <T> viewModel, Func <List <T> > request)
 {
     return(viewModel.RequestModel(request, response => {
         //viewModel.CreateMore(response, m => viewModel.MoreItems = m, viewModel.Items.AddRange);
         viewModel.Items.Reset(response);
     }));
 }
Esempio n. 2
0
        public static Task SimpleCollectionLoad <T>(this CollectionViewModel <T> viewModel, Func <BitbucketSharp.Models.V2.Collection <T> > request)
        {
            var weakVm = new WeakReference <CollectionViewModel <T> >(viewModel);

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