private void CmdBindPasteTimeExecuted(object sender, ExecutedRoutedEventArgs e) { int Hour, Minute, Second; if (TimeCtrlExtensions.IsValidTime((string)System.Windows.Clipboard.GetData("Text"), TimePattern, out Hour, out Minute, out Second)) { Value = new DateTime(Value.Year, Value.Month, Value.Day, Hour, Minute, Second, Value.Millisecond, Value.Kind); } }
void CmdBindPasteTimeCanExecute(object sender, CanExecuteRoutedEventArgs e) { int Hour, Minute, Second; e.CanExecute = TimeCtrlExtensions.IsValidTime((string)System.Windows.Clipboard.GetData("Text"), TimePattern, out Hour, out Minute, out Second); }