public TimeSpanPicker()
        {
            this.currentPartIndex = -1;
            this.parts = new List<IndexedDateTimePart>();
            this.InitializeComponent();
            this.upDownButtons = new TextBoxUpDownAdorner(this.TimeSpanDisplay);
            this.upDownButtons.Button_Clicked += (textBox, direction) => { this.IncrementOrDecrement(direction); };

            this.TimeSpanDisplay.GotFocus += this.TimeSpanPicker_GotFocus;
            this.TimeSpanDisplay.LostFocus += this.TimeSpanPicker_LostFocus;
            this.TimeSpanDisplay.IsVisibleChanged += this.TimeSpanPicker_IsVisibleChanged;
            this.TimeSpanDisplay.PreviewMouseUp += this.TimeSpanPicker_PreviewMouseUp;
            this.TimeSpanDisplay.PreviewKeyDown += this.TimeSpanPicker_PreviewKeyDown;
            this.TimeSpanDisplay.TextChanged += this.TimeSpanPicker_TextChanged;

            TimeSpanPicker.SetFormat(this, new DependencyPropertyChangedEventArgs(TimeSpanPicker.FormatProperty, Constant.Time.TimeSpanDisplayFormat, Constant.Time.TimeSpanDisplayFormat));
            TimeSpanPicker.SetValue(this, new DependencyPropertyChangedEventArgs(TimeSpanPicker.ValueProperty, TimeSpan.Zero, TimeSpan.Zero));
        }
        public DateTimeOffsetPicker()
        {
            this.currentPartIndex = -1;
            this.monthPartIndex = int.MaxValue;
            this.parts = new List<IndexedDateTimePart>();
            this.InitializeComponent();
            this.upDownButtons = new TextBoxUpDownAdorner(this.DateTimeDisplay);
            this.upDownButtons.Button_Clicked += (textBox, direction) => { this.IncrementOrDecrement(direction); };

            this.Calendar.SelectedDatesChanged += this.Calendar_SelectedDatesChanged;
            this.DateTimeDisplay.GotFocus += this.DateTimeDisplay_GotFocus;
            this.DateTimeDisplay.LostFocus += this.DateTimeDisplay_LostFocus;
            this.DateTimeDisplay.IsVisibleChanged += this.DateTimeDisplay_IsVisibleChanged;
            this.DateTimeDisplay.PreviewMouseUp += this.DateTimeDisplay_PreviewMouseUp;
            this.DateTimeDisplay.PreviewKeyDown += this.DateTimeDisplay_PreviewKeyDown;
            this.DateTimeDisplay.TextChanged += this.DateTimeDisplay_TextChanged;

            DateTimeOffsetPicker.SetFormat(this, new DependencyPropertyChangedEventArgs(DateTimeOffsetPicker.FormatProperty, Constant.Time.DateTimeDisplayFormat, Constant.Time.DateTimeDisplayFormat));
        }