コード例 #1
0
        public MainListViewModel()
        {
            SharedInstance = this;
            Posts          = new ObservableCollection <ImgurImage>();
            SortTypes      = new List <SortType>();
            SortTypes.Add(new SortType()
            {
                Value = (int)ImgurGallerySort.Viral, Name = "Popular"
            });
            SortTypes.Add(new SortType()
            {
                Value = (int)ImgurGallerySort.Time, Name = "Newest"
            });
            CurrenSort = SortTypes[0];

            RefreshCommand    = new RelayCommand(ExecuteRefreshCommand);
            SetPopularCommand = new RelayCommand(ExecuteSetPopularCommand);
            SetNewestCommand  = new RelayCommand(ExecuteSetNewestCommand);
            LoadData();
        }
コード例 #2
0
 public PostViewModel(MainListViewModel parentViewModel)
 {
     ParentViewModel = parentViewModel;
     BackCommand     = new RelayCommand(ExecuteBackCommand);
     ShareCommand    = new RelayCommand(ExecuteShareCommand);
 }