public ScoutRanksViewModel() { if (IsInDesignMode) { // Code runs in Blend --> create design time data. } else { // Code runs "for real": Connect to service, etc... var doc = XDocument.Load("Data/ScoutRanks.xml"); foreach (var item in doc.Element("ScoutRanks").Elements("Rank")) { var r = new Rank() { Name = item.Element("Name").Value, Requirements = item.Element("Requirements").Value, ImageUrl = item.Element("ImageUrl").Value, Description = item.Element("Description").Value, SequenceNumber = Int32.Parse(item.Element("SequenceNumber").Value), }; this.Ranks.Add(r); } } }
public override void Cleanup() { this.RankObject = null; base.Cleanup(); }
public RankSelectedMessage(Rank rank) { Rank = rank; }