MenuWeekModel.cs CampusAppWP8::Model::Mensa::MenuWeekModel CampusAppWP8::Model::Mensa //----------------------------------------------------------------------- //<copyrightfile="MenuWeekModel.cs"company="BTU/IIT"> //Companycopyrighttag. //</copyright> //<author>stubbfel</author> //<sience>03.05.2013</sience> //---------------------------------------------------------------------- namespaceCampusAppWP8.Model.Mensa { usingSystem; usingSystem.Collections.ObjectModel; usingSystem.Xml.Serialization; [XmlRoot("root")] publicclassMenuWeekModel { #regionMembers privatereadonlyDateTimecreateTime; publicMenuWeekModel() { this.createTime=DateTime.Now; } #endregion #regionConstructor [XmlArray("BTU")] [XmlArrayItem("Tagesmenu")] publicObservableCollection<MenuModel>Menus{get;set;} #endregion #regionProberty publicDateTimeCreateTime { get { returnthis.createTime; } } #endregion #regionMethods publicstaticDateTimeCalcFirstWeekDay() { DateTimenow=DateTime.Now; while(now.DayOfWeek!=DayOfWeek.Monday) { now=now.Subtract(newTimeSpan(1,0,0,0)); } DateTimemonday=newDateTime(now.Year,now.Month,now.Day); returnmonday; } #endregion } }