コード例 #1
0
 private void SortType_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (SortType.SelectedIndex == 0)
     {
         view.Sets = new ObservableCollection <SetView>(
             view.Sets.OrderByDescending(s => s.Efficiency));
         view        = new SetsPageView(view);
         DataContext = view;
     }
     if (SortType.SelectedIndex == 1)
     {
         view.Sets = new ObservableCollection <SetView>(
             view.Sets.OrderByDescending(s => s.Popularity));
         view        = new SetsPageView(view);
         DataContext = view;
     }
     if (SortType.SelectedIndex == 2)
     {
         view.Sets = new ObservableCollection <SetView>(
             view.Sets.OrderByDescending(s => s.Complexity));
         view        = new SetsPageView(view);
         DataContext = view;
     }
     if (SortType.SelectedIndex == 3)
     {
         view.Sets = new ObservableCollection <SetView>(
             view.Sets.OrderByDescending(s => s.AverageStudyTime));
         view        = new SetsPageView(view);
         DataContext = view;
     }
 }
コード例 #2
0
        private void UpdatePage()
        {
            var sets      = CatLangRestClient.GetAllSets();
            var setModels = new ObservableCollection <SetView>(sets.Select(s => new SetView(s)).ToList());

            view        = new SetsPageView(setModels);
            DataContext = view;

            LearnSet.IsEnabled = false;
        }
コード例 #3
0
 public SetsPageView(SetsPageView view)
 {
     SelectedItem = null;
     Sets         = view.Sets;
     UpdIconPath  = view.UpdIconPath;
 }