Skip to content

Commit

Permalink
Fix a bug where selected date won't be selected if OnDateSelected is …
Browse files Browse the repository at this point in the history
…null
  • Loading branch information
Aaron He committed Dec 13, 2013
1 parent b5cc1ce commit fef0ed5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions MonoDroid.TimesSquare/CalendarPickerView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@ private void OnCellClicked(MonthCellDescriptor cell)
OnInvalidDateSelected(this, new DateSelectedEventArgs(clickedDate));
}
}
else if (OnDateSelected != null) {
if (DoSelectDate(clickedDate, cell)) {
OnDateSelected(this, new DateSelectedEventArgs(clickedDate));
}
else {
OnDateUnselected(this, new DateSelectedEventArgs(clickedDate));
else {
bool wasSelected = DoSelectDate(clickedDate, cell);
if (OnDateSelected != null) {
if (wasSelected) {
OnDateSelected(this, new DateSelectedEventArgs(clickedDate));
}
else if(OnDateUnselected != null) {
OnDateUnselected(this, new DateSelectedEventArgs(clickedDate));
}
}
}
}
Expand Down

0 comments on commit fef0ed5

Please sign in to comment.