コード例 #1
0
        private async void TimeButton_Click(object sender, RoutedEventArgs e)
        {
            await this.Window.RunAsyncOperation(async() =>
            {
                Button button      = (Button)sender;
                QuoteListing quote = (QuoteListing)button.DataContext;

                ClockDialogControl calendarControl = new ClockDialogControl(quote.Quote.DateTime);
                string result = await MessageBoxHelper.ShowCustomDialog(calendarControl);
                if (!string.IsNullOrEmpty(result) && result.Equals("True"))
                {
                    quote.Quote.DateTime = quote.Quote.DateTime.Date + calendarControl.SelectedTime.TimeOfDay;
                }
            });
        }
コード例 #2
0
 private async void TimeButton_Click(object sender, RoutedEventArgs e)
 {
     await this.Window.RunAsyncOperation(async() =>
     {
         Button button = (Button)sender;
         if (button.DataContext != null)
         {
             UserQuoteViewModel quote           = (UserQuoteViewModel)button.DataContext;
             ClockDialogControl calendarControl = new ClockDialogControl(quote.DateTime);
             if (bool.Equals(await DialogHelper.ShowCustom(calendarControl), true))
             {
                 quote.DateTime = quote.DateTime.Date + calendarControl.SelectedTime.TimeOfDay;
             }
         }
     });
 }