コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
 public override void Cleanup()
 {
     this.RankObject = null;
     base.Cleanup();
 }
コード例 #3
0
 public RankSelectedMessage(Rank rank)
 {
     Rank = rank;
 }