In general, the out-of-the-box templates are great as a pattern but rarely as your implementation.
I'm assuming you're getting the exception on the first line of code in the following method?
public static IEnumerable<SampleDataGroupSecond> GetGroups(string uniqueId) { if (!uniqueId.Equals("AllGroups")) throw new ArgumentException("Only 'AllGroups' is supported as a collection of groups"); return _sampleDataSource.AllGroups; }
You're trying to mold a sample datasource into something that's not really appropriate for your data model needs. The implementation of this data source is explicitly indicating it's not set up to be used in the way you're trying to use it. If I understand correctly, you actually have groups of groups?
Again, the underlying datasource is a sample AND that sample includes three primary fields in the data model:
Image
,Title
andSubtitle
. Through XAML databinding, the sample data template (Standard250x250ItemTemplate
inStandardStyles.xaml
) is handling a very specific and narrow case.
I would start by laying out what your data model actually should look like - forget what's in the sample template. Day 7 of Microsoft's App Builder guidance includes a good section on working with data and files, including data binding which could be helpful to you.
When you master this, you'll realize your question about "where do I place the code is moot." There's rarely ANY code other than what it takes to get the data and assign it to your DataContext
.
For RSS specifically, the Blog Reader tutorial should help as well since it's specifically accessing and displaying items from an RSS feed.