private string getCurrentStringHoliday(int year, int month) { int dayInMonth = DateTime.DaysInMonth(year, month); string str = ""; for (int i = 1; i <= dayInMonth; i++) { if (ListHoliday.Contains(i.ToString())) { str += "H"; } else { str += "W"; } } return(str); }
public void Execute(object parameter) { TextBlock item = (parameter as TextBlock); SolidColorBrush r = item.Foreground as SolidColorBrush; //MessageBox.Show(r.Color.ToString()); if (r.Color.ToString().Equals("#FFFF0000")) { this.viewModel.ColorText = Colors.Black.ToString(); //(parameter as TextBlock).Foreground = new SolidColorBrush(Colors.Black); //remove items in list holiday ListHoliday.Remove(item.Text); } else { this.viewModel.ColorText = Colors.Red.ToString(); //(parameter as TextBlock).Foreground = new SolidColorBrush(Colors.Red); //add item in list holiday ListHoliday.Add(item.Text); } }