Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. private int monthIndex = DateTime.Today.Month - 1;
  2.  
  3. public int MonthIndex
  4. {
  5. get { return monthIndex; }
  6. set
  7. {
  8. if (monthIndex != value)
  9. {
  10. monthIndex = value;
  11. RaisePropertyChanged("MonthIndex");
  12. }
  13. }
  14. }
  15.  
  16. private int _dayIndex = DateTime.Today.Day - 1;
  17.  
  18. <ComboBox Name="cboDay"
  19. ItemsSource="{Binding DaysList, Mode=OneTime}"
  20. DisplayMemberPath="fltDay"
  21. SelectedIndex="{Binding DayIndex, Mode=TwoWay}"
  22. IsEditable="True" />
  23.  
  24. public ObservableCollection<Day> DaysList { get; set; }
  25. private int _dayIndex;
  26.  
  27. public int DayIndex
  28. {
  29. get
  30. {
  31. // perform some calculation logic;
  32. return _dayIndex;
  33. }
  34.  
  35. set
  36. {
  37. if (_dayIndex != value)
  38. {
  39. _dayIndex = value;
  40. RaisePropertyChanged("DayIndex");
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement