/// <summary>
        /// Handle the Unit property changing.
        /// </summary>
        /// <param name="sender">The enum text box whose unit changed.</param>
        /// <param name="eventArgs">The event arguments.</param>
        private static void OnUnitChanged(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
        {
            EnumTextBox box = sender as EnumTextBox;

            if (box.UnitChanged != null)
            {
                box.UnitChanged(sender, eventArgs);
            }
        }
        /// <summary>
        /// Handle the Type property changing.
        /// </summary>
        /// <param name="sender">The enum text box whose unit changed.</param>
        /// <param name="eventArgs">The event arguments.</param>
        private static void OnTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
        {
            EnumTextBox box = sender as EnumTextBox;

            if (box.Type != null)
            {
                box.Mask = @"(((\d{1,3}(,\d\d\d)*)|\d+)(\.\d+)?|\.\d+) +" + box.GetEnumValues();
                box.Unit = (Enum)Enum.GetValues(box.Type).GetValue(0);
            }
        }
 /// <summary>
 /// Create a converter and bind it to a TermLength.
 /// </summary>
 /// <param name="box">The TermLength object this converter is associated with.</param>
 public EnumLengthConverter(EnumTextBox box)
 {
     this.box = box;
 }