private void DatePicker_DateSelected(object sender, DateChangedEventArgs e)
        {
            (BindingContext as MccheyneViewModel).today = e.NewDate.ToString("M_d");
            DateTime thisDate = MccheyneViewModel.GetCorrectDateLeapYear(e.NewDate);

            (BindingContext as MccheyneViewModel).GetMccheyne(thisDate);
            (BindingContext as MccheyneViewModel).GetMccheyneRange(thisDate);
        }
Beispiel #2
0
        private async void OnDatePickerDateSelected(object sender, DateChangedEventArgs e)
        {
            if (!(BindingContext is MccheyneViewModel viewModel))
            {
                return;
            }

            viewModel.Today = e.NewDate.ToString("M_d");
            viewModel.CurrentSettedDateTime = MccheyneViewModel.GetCorrectDateLeapYear(e.NewDate);

            viewModel.IsRefreshing = true;

            var task1 = viewModel.GetMccheyne();
            var task2 = viewModel.GetMccheyneRange();
            await Task.WhenAll(task1, task2);

            viewModel.SetTodayCheckList();

            viewModel.IsRefreshing = false;

            DependencyService.Get <IHapticFeedback>().Run();

            mccheyneCollectionView.ScrollTo(0);
        }