private async Task updateData(DataStorage myDataStorage) { RestService myService = new RestService(); myDataStorage.setDataList(await myService.RefreshDataAsync()); }
private void addTapHandlers(DataStorage myDataStorage) { ContentPage initialPage = new TimekeeperDisplayApp.UsersPage(myDataStorage, pageHolder); pageHolder.Content = initialPage.Content; usersView.BackgroundColor = Color.FromHex("#0080ff"); users.BackgroundColor = Color.FromHex("#0080ff"); var tapUser = new TapGestureRecognizer(); tapUser.Tapped += (s, e) => { ContentPage usersPage = new TimekeeperDisplayApp.UsersPage(myDataStorage, pageHolder); pageHolder.Content = usersPage.Content; resetToGrey(); usersView.BackgroundColor = Color.FromHex("#0080ff"); users.BackgroundColor = Color.FromHex("#0080ff"); myDataStorage.sortAppListBy("name"); }; users.GestureRecognizers.Add(tapUser); var tapUsage = new TapGestureRecognizer(); tapUsage.Tapped += (s, e) => { ContentPage usagePage = new TimekeeperDisplayApp.UsagePage(myDataStorage, pageHolder); pageHolder.Content = usagePage.Content; resetToGrey(); appsView.BackgroundColor = Color.FromHex("#0080ff"); appsUsage.BackgroundColor = Color.FromHex("#0080ff"); }; appsUsage.GestureRecognizers.Add(tapUsage); var tapTrends = new TapGestureRecognizer(); tapTrends.Tapped += (s, e) => { ContentPage trendsPage = new TimekeeperDisplayApp.TrendsPage(); pageHolder.Content = trendsPage.Content; resetToGrey(); trendsView.BackgroundColor = Color.FromHex("#0080ff"); trends.BackgroundColor = Color.FromHex("#0080ff"); myDataStorage.sortAppListBy("classification"); }; trends.GestureRecognizers.Add(tapTrends); var tapTasks = new TapGestureRecognizer(); tapTasks.Tapped += (s, e) => { ContentPage tasksPage = new TimekeeperDisplayApp.TasksPage(); pageHolder.Content = tasksPage.Content; resetToGrey(); tasksView.BackgroundColor = Color.FromHex("#0080ff"); tasks.BackgroundColor = Color.FromHex("#0080ff"); myDataStorage.sortAppListBy("timespan"); }; tasks.GestureRecognizers.Add(tapTasks); var tapOptions = new TapGestureRecognizer(); tapOptions.Tapped += (s, e) => { ContentPage optionsPage = new TimekeeperDisplayApp.OptionsPage(); pageHolder.Content = optionsPage.Content; resetToGrey(); optionsView.BackgroundColor = Color.FromHex("#0080ff"); options.BackgroundColor = Color.FromHex("#0080ff"); myDataStorage.reverse("applist"); }; options.GestureRecognizers.Add(tapOptions); }
public MainPage(DataStorage myDataStorage) { InitializeComponent(); updateAndDisplay(myDataStorage); }