// 2 Code that runs when the underlying data value changes
        public static void OnDurationPropertyChanged(
            DependencyObject re, DependencyPropertyChangedEventArgs e)
        {
            DurationEditorInternal de = (DurationEditorInternal)re;
            TimeSpan ts = TimeSpan.FromMinutes(int.Parse(e.NewValue.ToString()));

            de.HourTextbox.Text   = Math.Floor(ts.TotalHours).ToString();
            de.MinuteTextbox.Text = ts.Minutes.ToString();
        }
Beispiel #2
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/ApressExtensionCS.Client;component/Presentation/Controls/DurationEditor.xaml", System.UriKind.Relative));
     this.DurationControl = ((ApressControlsCS.DurationEditorInternal)(this.FindName("DurationControl")));
 }