Ejemplo n.º 1
0
 public MyCommentViewModel()
 {
     Comments = new IncrementalLoadingList <Comment>(GetComments, () => { IsActive = false; }, () => { IsActive = true; });
     if (IsDesignMode)
     {
         LoadDesignTimeData();
     }
 }
Ejemplo n.º 2
0
 public MyFavoritePageViewModel()
 {
     Favorites = new IncrementalLoadingList <Document>(GetFavoritesDocument, () => { IsActive = false; }, () => { IsActive = true; });
     if (IsDesignMode)
     {
         LoadDesignData();
     }
 }
        public MyContributePageViewModel()
        {
            Contributes = new IncrementalLoadingList <Contribute>(GetContributes, () => { IsActive = false; }, () => { IsActive = true; });

            if (IsDesignMode)
            {
                LoadDesignData();
            }
        }
        public ContributeInChannelViewModel()
        {
            if (IsDesignMode)
            {
                ChannelId = "3";
            }

            Contributes = new IncrementalLoadingList <Contribute>(LoadContributesAsync, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { ToastService.SendToast(e.Message); IsActive = false; });
        }
Ejemplo n.º 5
0
        public MyReadHistoryPageViewModel()
        {
            ReadHistories = new IncrementalLoadingList <Document>(GetReadHistory, () => { IsActive = false; }, () => { IsActive = true; });

            if (IsDesignMode)
            {
                LoadDesignTimeData();
            }
        }
Ejemplo n.º 6
0
        public SearchPageViewModel()
        {
            SearchResults = new IncrementalLoadingList <Document>(SearchAsync, () => { IsActive = false; }, () => { IsActive = true; }, (Exception e) => { IsActive = false; ToastService.SendToast(e.Message); });

            if (DesignMode.DesignModeEnabled)
            {
                Keyword = "标准";
                Search();
            }
        }
Ejemplo n.º 7
0
 public PickPinPaneViewModel(IApiHttpHelper httpHelper,
                             IThemeService themeService,
                             IAccountService accountService,
                             Context context)
 {
     this.httpHelper     = httpHelper;
     this.themeService   = themeService;
     this.accountService = accountService;
     this.Context        = context;
     BoardList           = new IncrementalLoadingList <Board>(GetMyBoards);
 }
Ejemplo n.º 8
0
        public MessagePageViewModel()
        {
            if (IsDesignMode)
            {
                //LoadDesignData();
            }

            CommentMessages = new IncrementalLoadingList <Message>(LoadCommentMessages, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { IsActive = false; ToastService.SendToast(e.Message); });
            VoteMessages    = new IncrementalLoadingList <Message>(LoadVoteMessage, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { IsActive = false; ToastService.SendToast(e.Message); });
            AdminMessages   = new IncrementalLoadingList <Message>(LoadAdminMessage, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { IsActive = false; ToastService.SendToast(e.Message); });
        }
Ejemplo n.º 9
0
        public MainPageViewModel()
        {
            Documents   = new IncrementalLoadingList <Document>(LoadDocuments, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { IsActive = false; ToastService.SendToast(e.Message); });
            Videos      = new IncrementalLoadingList <Video>(LoadVideos, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { IsActive = false; ToastService.SendToast(e.Message); });
            Contributes = new IncrementalLoadingList <Contribute>(LoadContributes, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { IsActive = false; ToastService.SendToast(e.Message); });

            VoteVideoCommand = new RelayCommand(async(x) => await VoteVideoAsync((string)x));
            CommentCommand   = new RelayCommand(x => NavigateToComment((string)x));
            ShareCommand     = new RelayCommand(x => Share((Video)x));

            User = DataShareManager.Current.User;
            DataShareManager.Current.DataChanged += Current_DataChanged;
        }
Ejemplo n.º 10
0
        public PinListViewModel(Context context, Func <uint, int, Task <IEnumerable <Pin> > > _func)
            : base(context)
        {
            PinAPI             = ServiceLocator.Resolve <PinAPI>();
            BoardAPI           = ServiceLocator.Resolve <BoardAPI>();
            PinList            = new IncrementalLoadingList <Pin>(_func);
            SelecterVisibility = Visibility.Collapsed;

            QuickBoardChanged += (s, e) =>
            {
                InitQuickBoard();
            };

            InitQuickBoard();
        }
Ejemplo n.º 11
0
		public PinListViewModel(Context context, Func<uint, int, Task<IEnumerable<Pin>>> _func)
			: base(context)
		{
			PinAPI = ServiceLocator.Resolve<PinAPI>();
			BoardAPI = ServiceLocator.Resolve<BoardAPI>();
			PinList = new IncrementalLoadingList<Pin>(_func);
			SelecterVisibility = Visibility.Collapsed;

			QuickBoardChanged += (s, e) =>
			{
				InitQuickBoard();
			};

			InitQuickBoard();
		}
Ejemplo n.º 12
0
        public CommentPageViewModel()
        {
            if (IsDesignMode)
            {
                DocumentId = "44791";
            }

            LatestComments = new IncrementalLoadingList <Comment>(LoadLatestComments, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { ToastService.SendToast(e.Message); IsActive = false; });
            HotComments    = new IncrementalLoadingList <Comment>(LoadHotComments, () => { IsActive = false; }, () => { IsActive = true; }, (e) => { ToastService.SendToast(e.Message); IsActive = false; });

            CommentCommand = new RelayCommand
                             (
                async(commentId) =>
            {
                await ReplyCommentAsync((string)commentId, Content);
            },
                () =>
            {
                return(!string.IsNullOrEmpty(Content));
            }
                             );

            VoteCommand = new RelayCommand
                          (
                (commentId) =>
            {
                VoteAsync((string)commentId);
            }
                          );

            ReportCommand = new RelayCommand
                            (
                (commentId) =>
            {
                ReportAsync((string)commentId);
            }
                            );
        }
Ejemplo n.º 13
0
 public ChannelViewModel()
 {
     Channels = new IncrementalLoadingList <Channel>(GetChannel, () => { IsActive = false; }, () => { isActive = true; }, (e) => { ToastService.SendToast(e.Message); IsActive = false; });
 }
Ejemplo n.º 14
0
 public PinListViewModel(Context context, Func <uint, int, Task <IEnumerable <Pin> > > _func)
     : base(context)
 {
     PinList = new IncrementalLoadingList <Pin>(_func);
     this.SetWidth(Window.Current.Bounds.Width);
 }
Ejemplo n.º 15
0
		public Context()
		{
			CategoryList = new IncrementalLoadingList<Category>(GetCategoryList);
			Categories = new ObservableCollection<Category>();
		}
Ejemplo n.º 16
0
		public BoardListViewModel(Context context, Func<uint, int, Task<IEnumerable<Board>>> _func)
			: base(context)
		{
			BoardList = new IncrementalLoadingList<Board>(_func);
		}
Ejemplo n.º 17
0
 public UserListViewModel(Context context, Func <uint, int, Task <IEnumerable <User> > > _func)
     : base(context)
 {
     UserList = new IncrementalLoadingList <User>(_func);
 }
Ejemplo n.º 18
0
 public BoardListViewModel(Context context, Func <uint, int, Task <IEnumerable <Board> > > _func)
     : base(context)
 {
     BoardList = new IncrementalLoadingList <Board>(_func);
 }
Ejemplo n.º 19
0
		public UserListViewModel(Context context, Func<uint, int, Task<IEnumerable<User>>> _func)
			: base(context)
		{
			UserList = new IncrementalLoadingList<User>(_func);
		}