コード例 #1
0
        /// <summary>
        /// Creates and adds a few ItemViewModel objects into the Items collection.
        /// </summary>
        public async Task LoadSeriesIndexDataAsync()
        {
            if (IsIndexDataLoaded)
            {
                return;
            }
            LoadingText = "Loading series index data...";
            IsLoading   = true;
            try
            {
                var serIndex = await CachedClient.GetSeriesIndexAsync();

                //var serVmList = serIndex.Select(series => new SeriesPreviewModel { ID = series.Id, Title = series.Title });
                var cgs = new Windows.Globalization.Collation.CharacterGroupings();
                SeriesIndex = (from series in serIndex
                               group series
                               by cgs.Lookup(series.Title) into g
                               orderby g.Key
                               select g).ToList();

                //SeriesIndex = AlphaKeyGroup<SeriesPreviewModel>.CreateGroups(
                //	serVmList,
                //	new System.Globalization.CultureInfo("zh-Hans"),
                //	svm => svm.Title, true);
                IsIndexDataLoaded = true;
            }
            catch (Exception exception)
            {
                Debug.WriteLine("Exception when retrieving series index : " + exception.Message);
                //throw exception;
                //MessageBox.Show(exception.Message, "Data error", MessageBoxButton.OK);
            }
            IsLoading = false;
        }
コード例 #2
0
		public async Task LoadSeriesIndexDataAsync()
		{
			if (IsLoaded) return;
			IsLoading = true;
			try
			{
				var serIndex = await CachedClient.GetSeriesIndexAsync();

				var cgs = new Windows.Globalization.Collation.CharacterGroupings();
				SeriesIndex = (from series in serIndex
							   group series
							   by cgs.Lookup(series.Title) into g
							   orderby g.Key
							   select g).ToList();

				IsLoaded = true;
			}
			catch (Exception exception)
			{
				Debug.WriteLine("Exception when retrieving series index : " + exception.Message);
				//throw exception;
				//MessageBox.Show(exception.Message, "Data error", MessageBoxButton.OK);
			}
			IsLoading = false;
		}
コード例 #3
0
        public async Task LoadSeriesIndexDataAsync()
        {
            if (IsLoaded)
            {
                return;
            }
            IsLoading = true;
            try
            {
                var serIndex = await CachedClient.GetSeriesIndexAsync();

                var cgs = new Windows.Globalization.Collation.CharacterGroupings();
                SeriesIndex = (from series in serIndex
                               group series
                               by cgs.Lookup(series.Title) into g
                               orderby g.Key
                               select g).ToList();

                IsLoaded = true;
            }
            catch (Exception exception)
            {
                Debug.WriteLine("Exception when retrieving series index : " + exception.Message);
                //throw exception;
                //MessageBox.Show(exception.Message, "Data error", MessageBoxButton.OK);
            }
            IsLoading = false;
        }