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); } }