Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
 static IPAddrBox()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(IPAddrBox), new FrameworkPropertyMetadata(typeof(IPAddrBox)));
     TextProperty.AddOwner(typeof(IPAddrBox));
 }
Exemplo n.º 3
0
 static TimePicker()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(TimePicker), new FrameworkPropertyMetadata(typeof(TimePicker)));
     TextProperty.AddOwner(typeof(TimePicker));
 }