private void Refresh() { IsRefreshing = true; Birthdays.ReplaceRangeWithoutUpdating(BirthdaysRepository .GetAll() .ToAchievementStepViewModels() .OrderBy(x => x.BirthDayDate)); Birthdays.RaiseCollectionChanged(); IsRefreshing = false; }
private void InitRepositories() { AutoReply = new AutoReplyRepository(Context); Birthdays = new BirthdaysRepository(Context); BotDb = new BotDbRepository(Context); EmoteStats = new EmoteStatsRepository(Context); ChannelStats = new ChannelStatsRepository(Context); Log = new LogRepository(Context); TeamSearch = new TeamSearchRepository(Context); TempUnverify = new TempUnverifyRepository(Context); Config = new ConfigRepository(Context); }
private async Task DeleteBirthday(BirthdayViewModel viewModel) { bool result = await UserDialogs.Instance.ConfirmAsync( ConstantsHelper.BirthdaysDeleteMessage, ConstantsHelper.Warning, ConstantsHelper.Ok, ConstantsHelper.Cancel); if (result) { Birthdays.Remove(viewModel); var modelToDelete = BirthdaysRepository.GetBirthdayAsync(viewModel.Id); if (modelToDelete != null) { BirthdaysRepository.DeleteBirthday(modelToDelete); } } }
public App() { InitializeComponent(); string dbPath = DependencyService.Get <IFileHelper>().GetLocalFilePath(ConstantsHelper.SqLiteDataBaseName); NoteRepository = new NoteRepository(dbPath); ToDoRepository = new ToDoRepository(dbPath); AchievementRepository = new AchievementRepository(dbPath); UserRepository = new UserRepository(dbPath); BirthdaysRepository = new BirthdaysRepository(dbPath); bool.TryParse(Settings.UsePin, out bool shouldUsePin); if (shouldUsePin) { MainPage = new PinPage(); } else { MainPage = new LoginPage(); } MessagingCenter.Subscribe <object, string>(this, NotificationReceivedKey, OnMessageReceived); }