Exemplo n.º 1
0
 private async void RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     using (var deferral = args.GetDeferral())
     {
         await FetchAsync(4);
     }
 }
Exemplo n.º 2
0
 private async void OnRefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     using (var complion = args.GetDeferral())
     {
         await MainViewModel.Current.FetchCosts();
     }
 }
 public async void RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     using (var RefreshCompletionDeferral = args.GetDeferral())
     {
         await Refresh();
     }
 }
Exemplo n.º 4
0
        private async void RefreshContainer_RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs e)
        {
            Deferral deferral = e.GetDeferral();

            await ViewModel.RefreshAsync();

            deferral.Complete();
        }
        public async void PullToRefresh_ListView(object sender, RefreshRequestedEventArgs e)
        {
            var deferral = e.GetDeferral();

            await BuildList();

            deferral.Complete();
        }
        public async void PullToRefresh_ListView(object sender, RefreshRequestedEventArgs e)
        {
            var deferral = e.GetDeferral();

            await GetMessageGroups(Shell.Instance.ViewModel.CurrentUser.Username);

            deferral.Complete();
        }
Exemplo n.º 7
0
 private async void RefreshContainer_RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     using (var deferral = args.GetDeferral())
     {
         var contactservices = new ContactServices();
         var contacts        = (await contactservices.ListAsync()).ToList();
         ContactListView.ItemsSource = contacts;
     }
 }
Exemplo n.º 8
0
 private async void RefreshContainer_OnRefreshRequested(
     RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     using (var refrechCompletionDeferral = args.GetDeferral()) {
         var contactService = new ContactService();
         var contactList    = (await contactService.ListAsync()).ToList();
         MasterListView.ItemsSource = contactList;
     }
 }
Exemplo n.º 9
0
 void OnRefresh(object sender, RefreshRequestedEventArgs args)
 {
     CompleteRefresh();
     _refreshCompletionDeferral = args.GetDeferral();
     Element.SetValueFromRenderer(RefreshView.IsRefreshingProperty, true);
     if (Element?.Command?.CanExecute(Element?.CommandParameter) ?? false)
     {
         Element.Command.Execute(Element?.CommandParameter);
     }
 }
Exemplo n.º 10
0
        void OnRefresh(object sender, RefreshRequestedEventArgs args)
        {
            CompleteRefresh();
            _refreshCompletionDeferral = args.GetDeferral();

            if (VirtualView != null)
            {
                VirtualView.IsRefreshing = true;
            }
        }
Exemplo n.º 11
0
        private static async void RefreshContainerOnRefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
        {
            if (GetItemsSource(sender) is ISupportRefresh source)
            {
                using var def = args.GetDeferral();
                await source.Refresh();

                def.Complete();
            }
        }
Exemplo n.º 12
0
        private async void OnRefreshContainerRefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs e)
        {
            Deferral deferral = e.GetDeferral();

            if (ViewModel.RootFolder != null)
            {
                await ViewModel.RootFolder.FillAsync();
            }

            deferral.Complete();
        }
Exemplo n.º 13
0
 private void RefreshController_RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     using (var RefreshCompletionDeferral = args.GetDeferral())
     {
         // Do some async operation to refresh the content
         GridView.ItemsSource = null;
         GridView.ItemsSource = ItemManager.GetItemList(Globals.uid);
         RefreshCompletionDeferral.Complete();
         RefreshCompletionDeferral.Dispose();
     }
 }
 private void RefreshContainer_RefreshRequested(object sender, RefreshRequestedEventArgs args)
 {
     using (var deferral = args.GetDeferral())
     {
         RefreshRequested?.Invoke(this, EventArgs.Empty);
         if (RefreshCommand != null && RefreshCommand.CanExecute(null))
         {
             RefreshCommand.Execute(null);
         }
     }
 }
Exemplo n.º 15
0
        private async void OnRefreshRequested(object sender, RefreshRequestedEventArgs e)
        {
            if (!Allowed)
            {
                Toast.ShowError("不允许连接wifi,请确认已开启wifi,重新打开应用");
                return;
            }
            await firstAdapter.ScanAsync();

            LoadingVisibility = Visibility.Visible;
            await DisplayNetworkReport(firstAdapter.NetworkReport);

            e?.GetDeferral();
        }
Exemplo n.º 16
0
        public async void PullToRefresh_ListView(object sender, RefreshRequestedEventArgs e)
        {
            var deferral = e.GetDeferral();

            try
            {
                await SetTrophyDetailList();
            }
            catch (Exception)
            {
                // TODO: Add error checker here too?
            }
            deferral.Complete();
        }
Exemplo n.º 17
0
        private async void RefreshContainer_RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
        {
            // Respond to a request by performing a refresh and using the deferral object.
            using (var RefreshCompletionDeferral = args.GetDeferral())
            {
                // Do some async operation to refresh the content

                await MainPageViewModel.Refresh();

                // The 'using' statement ensures the deferral is marked as complete.
                // Otherwise, you'd call
                // RefreshCompletionDeferral.Complete();
                // RefreshCompletionDeferral.Dispose();
            }
        }
Exemplo n.º 18
0
        private async void OnRefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
        {
            if (!_upToDate)
            {
                _upToDate = true;

                var deferral = args.GetDeferral();

                await Task.Delay(1000);

                Cases.Insert(0, _caseToAdd);

                deferral.Complete();
            }
        }
 public Deferral GetDeferral(RefreshRequestedEventArgs e) => e.GetDeferral();
Exemplo n.º 20
0
 void OnRefresh(object sender, RefreshRequestedEventArgs args)
 {
     CompleteRefresh();
     _refreshCompletionDeferral = args.GetDeferral();
     Element.SetValueFromRenderer(RefreshView.IsRefreshingProperty, true);
 }
Exemplo n.º 21
0
 private void rc2_RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     this.RefreshCompletionDeferral2 = args.GetDeferral();
     //Do some work to show new content!
     timer2.Start();
 }
Exemplo n.º 22
0
 private void MemoryViewer_RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     //Do some work to show new Content! Once the work is done, call RefreshCompletionDeferral.Complete()
     this.RefreshCompletionDeferralForMemory = args.GetDeferral();
 }
 private void rc_RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
 {
     this.RefreshCompletionDeferral = args.GetDeferral();
     timer.Start();
 }