public GetRecentMessagesUC(IDownloadNewMessagesUC downloadRecentUC)
 {
     this.downloadRecentUC    = downloadRecentUC;
     this.messages            = new ObservableCollection <Database.Message>();
     this.messageSubscription = Realm.GetInstance()
                                .All <Database.Message>()
                                .OrderByDescending(m => m.SendAt)
                                .SubscribeForNotificationsOn(messages);
     this.readOnlyMessages = messages.ToReadOnly();
 }
예제 #2
0
 public ListPageViewModel(IDownloadOlderMessagesUC downloadOlderUC,
                          IDownloadNewMessagesUC downloadNewMessagesUC,
                          IGetRecentMessagesUC getRecentMessagesUC,
                          INavigationService navigationService) : base(navigationService)
 {
     Title = "Messages";
     this.downloadOlderUC       = downloadOlderUC;
     this.downloadNewMessagesUC = downloadNewMessagesUC;
     Messages = getRecentMessagesUC.Execute();
 }