Ejemplo n.º 1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _partTime = Template.FindName("PART_Time", this) as CnDTimeInputTextBox;
            if (_partTime == null)
            {
                throw new Exception("PART_Time is missing");
            }
            _partTime.AddExceptionKey(Key.Add);
            _partTime.AddExceptionKey(Key.Subtract);
            _partTime.TimeChanged += OnTimeChanged;

            var partPreviousDay = Template.FindName("PART_PreviousDay", this) as Button;

            if (partPreviousDay != null)
            {
                partPreviousDay.Click += (s, e) => SelectedDateTime = SelectedDateTime.AddDays(-1);
            }

            var partNextDay = Template.FindName("PART_NextDay", this) as Button;

            if (partNextDay != null)
            {
                partNextDay.Click += (s, e) => SelectedDateTime = SelectedDateTime.AddDays(1);
            }
        }
Ejemplo n.º 2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _partTime = Template.FindName("PART_Time", this) as CnDTimeInputTextBox;
            if (_partTime == null)
                throw new Exception("PART_Time is missing");
            _partTime.AddExceptionKey(Key.Add);
            _partTime.AddExceptionKey(Key.Subtract);
            _partTime.TimeChanged += OnTimeChanged;

            var partPreviousDay = Template.FindName("PART_PreviousDay", this) as Button;
            if (partPreviousDay != null)
                partPreviousDay.Click += (s, e) => SelectedDateTime = SelectedDateTime.AddDays(-1);

            var partNextDay = Template.FindName("PART_NextDay", this) as Button;
            if (partNextDay != null)
                partNextDay.Click += (s, e) => SelectedDateTime = SelectedDateTime.AddDays(1);
        }