private async void DateButton_Click(object sender, RoutedEventArgs e)
        {
            await this.RunAsyncOperation(async() =>
            {
                DateTimeOffset resetStart = (this.viewModel.IsNew || this.viewModel.Currency.ResetStartCadence == DateTimeOffset.MinValue) ? DateTimeOffset.Now : this.viewModel.Currency.ResetStartCadence;

                string identifier = "";
                if (this.viewModel.AutomaticResetRate == CurrencyResetRateEnum.Weekly)
                {
                    identifier = "Week";
                }
                else if (this.viewModel.AutomaticResetRate == CurrencyResetRateEnum.Monthly)
                {
                    identifier = "Month";
                }
                else if (this.viewModel.AutomaticResetRate == CurrencyResetRateEnum.Yearly)
                {
                    identifier = "Year";
                }

                CalendarDialogControl calendarControl = new CalendarDialogControl(resetStart, string.Format("Please select the Day of the {0} that this should be reset on:", identifier));
                if (bool.Equals(await DialogHelper.ShowCustom(calendarControl), true))
                {
                    this.viewModel.AutomaticResetStartTime = calendarControl.SelectedDate.Date;
                }
            });
        }
 private async void EndDateButton_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     await this.RunAsyncOperation(async() =>
     {
         CalendarDialogControl calendarControl = new CalendarDialogControl(this.viewModel.EndDate);
         if (bool.Equals(await DialogHelper.ShowCustom(calendarControl), true))
         {
             this.viewModel.EndDate = calendarControl.SelectedDate.Date;
         }
     });
 }
        private async void DateButton_Click(object sender, RoutedEventArgs e)
        {
            await this.Window.RunAsyncOperation(async() =>
            {
                Button button      = (Button)sender;
                QuoteListing quote = (QuoteListing)button.DataContext;

                CalendarDialogControl calendarControl = new CalendarDialogControl(quote.Quote.DateTime);
                string result = await MessageBoxHelper.ShowCustomDialog(calendarControl);
                if (!string.IsNullOrEmpty(result) && result.Equals("True"))
                {
                    quote.Quote.DateTime = calendarControl.SelectedDate.Date + quote.Quote.DateTime.TimeOfDay;
                }
            });
        }
Exemplo n.º 4
0
 private async void DateButton_Click(object sender, RoutedEventArgs e)
 {
     await this.Window.RunAsyncOperation(async() =>
     {
         Button button = (Button)sender;
         if (button.DataContext != null)
         {
             UserQuoteViewModel quote = (UserQuoteViewModel)button.DataContext;
             CalendarDialogControl calendarControl = new CalendarDialogControl(quote.DateTime);
             if (bool.Equals(await DialogHelper.ShowCustom(calendarControl), true))
             {
                 quote.DateTime = calendarControl.SelectedDate.Date + quote.DateTime.TimeOfDay;
             }
         }
     });
 }