private void RefreshBackground() { var now = DateTime.Now; var notes = Notes.Current.Items; var dayNotes = notes.Where(a => !a.IsMonthDay && MonthDayHelper.IsSameMonthDay(Convert.ToDateTime(a.Date), Day)) .Select(a => a.Name).ToList(); var monthDayNotes = notes.Where(a => a.IsMonthDay && MonthDayHelper.IsSameMonthMonthMonthDay(Convert.ToDateTime(a.Date), Day)) .Select(a => a.Name);; dayNotes.AddRange(monthDayNotes); if (dayNotes.Count > 0) { DayType = DayType.Note; NoteText = string.Join("\r\n", dayNotes); } else if (Day.Year == now.Year && Day.Month == now.Month && Day.Day == now.Day) { DayType = DayType.Today; NoteText = "今天"; } else if (Day.Year == AppModel.Current.Year && Day.Month == AppModel.Current.Month) { DayType = DayType.Normal; } else { DayType = DayType.OtherMonth; } }
private void RefreshMonthDayName() { MonthDayName = MonthDayHelper.GetMonthDateTimeWithoutYearR(Day); }