public void AddDateTimeControl(WpfEventManager wpfEventManager, DateTime defaultValue) { DateTimeInputControl = new DateTimeInputControlView { DefaultValue = defaultValue, WpfEventManager = wpfEventManager, }; DateTimeInputControl.ValueChanged += DateTimeInputControlView_ValueChanged; TheControlGrid.Children.Add(DateTimeInputControl); }
private static void OnPropsValueChangedHandler(DependencyObject d, DependencyPropertyChangedEventArgs e) { DateTimeInputControlView v = d as DateTimeInputControlView; if (e.Property.Name == nameof(DefaultValue)) { v.SetDefaultValue((DateTime)e.NewValue); } else if (e.Property.Name == nameof(WpfEventManager)) { v.SetWpfEventManager((WpfEventManager)e.NewValue); } }