private async void ReadData() { XDocument document = XDocument.Load("SDKConfig.xml"); foreach (var group in document.Root.Elements("Category")) { string groupName = (string)group.Element("name"); string groupStyle = (string)group.Element("style"); SampleDataGroup g = new SampleDataGroup(groupName, groupName, groupName, "", "", groupName, resources, groupStyle); foreach (var o in group.Elements("items").Elements<XElement>("item")) { string name = (string)o.Element("id"); string xaml = (string)o.Element("xaml"); string source = (string)o.Element("source"); string code = (string)o.Element("code"); string imageItemsPath = (string)o.Element("imageItemsPath"); string imageGroupsPath = (string)o.Element("imageGroupsPath"); string explain = string.Empty; try { explain = await PathIO.ReadTextAsync(string.Format("ms-appx:///{0}", (string)o.Element("explain"))); } catch { } SampleDataItem i = new SampleDataItem(name, name, name, imageItemsPath, imageGroupsPath, explain, xaml, g, code, source, resources, groupStyle); g.Items.Add(i); } AllGroups.Add(g); } }
public SampleDataItem(String uniqueId, String title, String subtitle, String imageItemsPath, String imageGroupsPath, String description, String content, SampleDataGroup group, string csCode, string xamlCode, ResourceDictionary res, String brushPath) : base(uniqueId, title, subtitle, imageItemsPath, imageGroupsPath, description, res, brushPath) { this._content = content; this._group = group; this.CSCode = csCode; this.XamlCode = xamlCode; }