public void HighlightBorder(bool highlight) { Calender2.App app = (Calender2.App)Application.Current; SolidColorBrush brush; if (highlight) { //brush = (SolidColorBrush)app.Resources["DateItemBorderHighlightColor"]; brush = (SolidColorBrush)app.Resources["DayItemHighlightBackGroundColor"]; } else { //brush = (SolidColorBrush)app.Resources["DateItemBorderColor"]; if (festival.Visibility == Visibility.Visible) { brush = (SolidColorBrush)app.Resources["DateItemFestivalBackgroundColor"]; } else { brush = (SolidColorBrush)app.Resources["DayItemBackGroundColor"]; } } mainStackPanel.Background = brush; }
public void SetDay(int dayVal, bool newMoonDay, bool fullMoonDay, String festivalString, String tithiString, String nakshatraString) { _dayOfMonth = dayVal; day.Text = dayVal.ToString(); if (newMoonDay) { amavasya.Visibility = Visibility.Visible; } else { amavasya.Visibility = Visibility.Collapsed; } if (fullMoonDay) { pournami.Visibility = Visibility.Visible; } else { pournami.Visibility = Visibility.Collapsed; } Calender2.App app = (Calender2.App)Application.Current; if (String.IsNullOrEmpty(festivalString) == false) { festival.Text = festivalString; festival.Visibility = Visibility.Visible; SolidColorBrush brush = (SolidColorBrush)app.Resources["DateItemFestivalBackgroundColor"]; mainStackPanel.Background = brush; } else { festival.Visibility = Visibility.Collapsed; SolidColorBrush brush = (SolidColorBrush)app.Resources["DayItemBackGroundColor"]; mainStackPanel.Background = brush; } if (String.IsNullOrEmpty(tithiString) == false) { //tithi.Text = tithiString; //tithi.Visibility = Visibility.Visible; } else { //tithi.Visibility = Visibility.Collapsed; } if (nakshatraString == "KeepExisting") { // do nothing } else if (String.IsNullOrEmpty(nakshatraString) == false) { nakshatra.Text = nakshatraString; nakshatra.Visibility = Visibility.Visible; } else { nakshatra.Visibility = Visibility.Collapsed; } }