提交记录修改UI/Controls/Select/DateSelect.cs+10 −5看文件
| @@ -62,9 +62,17 @@ namespace UI.Controls.Select | ||
| 62 | 62 | DependencyProperty.Register("Date", |
| 63 | 63 | typeof(DateTime), |
| 64 | 64 | typeof(DateSelect), |
| 65 | 删除: new PropertyMetadata(DateTime.Now) | |
| 65 | 新增: new PropertyMetadata(DateTime.Now, new PropertyChangedCallback(onDateChanged)) | |
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | 新增: private static void onDateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |
| 69 | 新增: { | |
| 70 | 新增: var control = d as DateSelect; | |
| 71 | 新增: control.Year = control.Date.Year; | |
| 72 | 新增: control.Month = control.Date.Month; | |
| 73 | 新增: control.SelectedDay = control.Date.Date; | |
| 74 | 新增: } | |
| 75 | 新增: | |
| 68 | 76 | public int Year |
| 69 | 77 | { |
| 70 | 78 | get { return (int)GetValue(YearProperty); } |
| @@ -157,10 +165,8 @@ namespace UI.Controls.Select | ||
| 157 | 165 | SetMonthCommand = new Command(new Action<object>(OnSetMonth)); |
| 158 | 166 | DoneCommand = new Command(new Action<object>(OnDone)); |
| 159 | 167 | |
| 160 | 删除: MouseLeftButtonUp += Select_MouseLeftButtonUp; | |
| 161 | 168 | |
| 162 | 169 | Year = Date.Year; |
| 163 | 删除: | |
| 164 | 170 | Month = Date.Month; |
| 165 | 171 | |
| 166 | 172 | //Day = new DayModel() |
| @@ -169,11 +175,10 @@ namespace UI.Controls.Select | ||
| 169 | 175 | //}; |
| 170 | 176 | |
| 171 | 177 | SelectedDay = Date.Date; |
| 172 | 删除: | |
| 173 | 178 | mouseProc = HookCallback; |
| 174 | 179 | |
| 175 | 180 | Unloaded += DateSelect_Unloaded; |
| 176 | 删除: | |
| 181 | 新增: MouseLeftButtonUp += Select_MouseLeftButtonUp; | |
| 177 | 182 | } |
| 178 | 183 | |
| 179 | 184 | |

