/// <summary> /// Initializes the <see cref="NumericTextBox" /> class. /// </summary> static NumericTextBox() { ValidNumberRegex = new Regex(@"^[-+]?[0-9]*([\.,][0-9]*)?$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.CultureInvariant); var frameworkPropertyMetadata = new FrameworkPropertyMetadata { CoerceValueCallback = CoerceTextValueCallback }; TextProperty.AddOwner(typeof(NumericTextBox), frameworkPropertyMetadata); DefaultStyleKeyProperty.OverrideMetadata(typeof(NumericTextBox), new FrameworkPropertyMetadata(typeof(NumericTextBox))); NumericSettingsProperty = DependencyProperty.Register("NumericSettings", typeof(NumericSettings), typeof(NumericTextBox), new PropertyMetadata(NumericSettingsChanged)); }
static IPAddrBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(IPAddrBox), new FrameworkPropertyMetadata(typeof(IPAddrBox))); TextProperty.AddOwner(typeof(IPAddrBox)); }
static TimePicker() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TimePicker), new FrameworkPropertyMetadata(typeof(TimePicker))); TextProperty.AddOwner(typeof(TimePicker)); }