public void SetDay(BLL.CalendarDay day) { lbl_Date.Content = day.Date.ToString("dddd, MMMM d yyyy"); txbl_EventList.Text = ""; ListEvents(day.Events); }
public void ShowDay(BLL.CalendarDay day) { currentDay = day; lbl_Date.Content = day.Date.ToString("MMMM d yyyy"); UpdateEvents(); txbl_EditButtonText.Text = "Edit"; grd_EditEvent.Height = 0; grd_CreateEvent.Height = 0; }
public MainWindow() { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); InitializeComponent(); this.Icon = new BitmapImage(new Uri("../../Images/TaskbarIcon.png", UriKind.Relative)); DAL.Package.URL = "http://api.openweathermap.org/data/2.5/weather"; App.Current.MainWindow = this; _tooltip.Topmost = true; _tooltip.ShowInTaskbar = false; _tooltip.Show(); _tooltip.Hide(); _dayOverview = new DayOverviewWindow(this); _dayOverview.ShowInTaskbar = false; _dayOverview.Hide(); DateTime today = DateTime.Today; _shownDate = new DateTime(today.Year, today.Month, 1); DateTime startDay = new DateTime(today.Year, today.Month, 1); int weekDayStart = (int)startDay.DayOfWeek; startDay = startDay.AddDays(-weekDayStart + 1); for (int i = 0; i < 42; i++) { BLL.CalendarDay cDay = new BLL.CalendarDay(this, startDay.Day); Grid dayGrid = cDay.GetGrid(); dayGrid.Margin = new Thickness(90 * (i % 7), 29 + 90 * (i / 7), 0, 0); grid_DayGrid.Children.Add(dayGrid); cDay.SetEventListTemplate((DataTemplate)this.FindResource("dayEventItem") as DataTemplate); _calendarDays[i % 7, i / 7] = cDay; startDay = startDay.AddDays(1); } UpdateCalendarDates(); }