コード例 #1
0
        public async Task LoadSpeakersAsync(RadListView lv)
        {
            if (lv == null)
            {
                IsBusy = true;
            }

            try
            {
                Speakers.Clear();

                var items = await DependencyService.Get <IDataStore <Speaker> >().GetItemsAsync(true);

                foreach (var item in items)
                {
                    Speakers.Add(item);
                }
            }
            catch (Exception ex)
            {
                bool wasManualRefresh = lv != null;

                Crashes.TrackError(ex, new Dictionary <string, string>
                {
                    { "Location", "SpeakersViewModel" },
                    { "Method", "LoadSpeakersAsync" },
                    { "WasManualRefresh", wasManualRefresh.ToString() },
                });
            }
            finally
            {
                lv?.EndRefresh(true);
                IsBusy = false;
            }
        }