示例#1
0
 protected void DateOpenedEvent(SelectedDateChangedEventArgs e)
 {
     if (OnDateOpenedEvent != null)
     {
         OnDateOpenedEvent(this, e);
     }
 }
        private void PART_Calendar_OnSelectedDateChangedEvent(object sender, SelectedDateChangedEventArgs e)
        {
            if (e.DateTime != null)
            {
                DateTime dt = (DateTime)e.DateTime;
                PART_Text.Text = string.Format("{0:0}/{1:0}/{2:0000}", dt.Month, dt.Day, dt.Year);
            }
            else
            {
                PART_Text.Text = null;
            }

            PART_Popup.IsOpen = false;
            SetValue(SelectedDateProperty, e.DateTime);
        }
示例#3
0
        private void text_Checked(object sender, RoutedEventArgs e)
        {
            if (!_suppressCheck)
            {
                RadioButton _sender = sender as RadioButton;
                DateTime    dt      = (DateTime)_sender.Tag;

                _checked      = dt;
                _checkedRadio = _sender;

                SetValue(SelectedDateProperty, dt);

                if (IsLoaded)
                {
                    if (dt.Month < _month)
                    {
                        _month = dt.Month;
                        _year  = dt.Year;
                        ClearOldLayout();
                        InitializeLayout();
                        FocusDate(dt.Day);
                    }
                    else if (dt.Month > _month)
                    {
                        _month = dt.Month;
                        _year  = dt.Year;
                        ClearOldLayout();
                        InitializeLayout();
                        FocusDate(dt.Day);
                    }

                    SelectedDateChangedEventArgs args = new SelectedDateChangedEventArgs(dt);
                    SelectedDateChangedEvent(args);
                }
            }

            _suppressCheck = false;
        }