コード例 #1
0
        /// <summary>
        /// 选中状态
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void rb_Checked(object sender, RoutedEventArgs e)
        {
            var rb       = (RadioButton)sender;
            var tag      = rb.Tag.ToString().Split('|');
            var index    = int.Parse(tag[0]);
            var datetime = Convert.ToDateTime(tag[1]);

            SelectedDateTime = datetime;
            if (index == ShowTabCount)
            {
                datetime = datetime.AddDays(-MidShowTabCount);

                CreateRadioTime(false, datetime);
            }
            else if (index == 1)
            {
                if (datetime.Date != DateTime.Now.Date)
                {
                    datetime = datetime.AddDays(-MidShowTabCount);
                    CreateRadioTime(false, datetime);
                }
            }
            if (RbChecked != null)
            {
                var re = new WeekRoutedEventArgs();
                re.DateTime = datetime;
                re.Index    = index;

                RbChecked(sender, re);
            }
        }
コード例 #2
0
        /// <summary>
        /// 未选中状态
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        void rb_Unchecked(object sender, RoutedEventArgs e)
        {
            if (RbUnChecked != null)
            {
                var rb       = (RadioButton)sender;
                var tag      = rb.Tag.ToString().Split('|');
                var index    = int.Parse(tag[0]);
                var datetime = Convert.ToDateTime(tag[1]);
                var re       = new WeekRoutedEventArgs();
                re.DateTime = datetime;
                re.Index    = index;
                RbUnChecked(sender, re);
            }
        }