C# Windows Store Grid App (xaml) template -


i'm creating c# windows 8 store application using windows store grid app (xaml) templates edit. first page, groupeditemspage template, drinks page. here i've edited simpledatasource method in simpledatasource.cs file add own images , titles (booze, soda, ...). these standard items did there.

hub page

when clicked on booze user goes booze page, groupeditemspage template. these 8 items (beer, wine, cocktails, ...) standard i've created second method in simpledatasource.cs file shown correct titles , images. here goes wrong. when clicked on "booze" "system.argumentexception". i've created public sealed class sampledatasourcesecond 1 in template. edited loadstate method of page.

    protected override void loadstate(object navigationparameter, dictionary<string, object> pagestate)     {         // todo: assign collection of bindable groups this.defaultviewmodel["groups"]         var sampledatagroupssecond = sampledatasourcesecond.getgroupssecond((string)navigationparameter);         this.defaultviewmodel["groupssecond"] = sampledatagroupssecond;     } 

when i'm looking @ xaml page in visual studio displays correct on runtime error comes.

drinks page

when clicked on "beer" goes page, groupdetailpage template. items "jupiler", "stella" should come rss feed title, description, image. second problem: because these not standard can't change in sampledatasource.cs file. should this?

beer page

so: 1. doing right? 2. how systemt.argumentexception solved? 3. should place code can fill groupdetailpage rss feed.

thanks in advance!

edit: items 2nd page can change. when clicked on booze should display on second page: beer, wine, cocktail, whisky, ... when clicked on soda: coca-cola, icetea, spriten ...

in general, out-of-the-box templates great pattern implementation.

  1. i'm assuming you're getting exception on first line of code in following method?

    public static ienumerable<sampledatagroupsecond> getgroups(string uniqueid) {     if (!uniqueid.equals("allgroups")) throw new argumentexception("only 'allgroups' supported collection of groups");      return _sampledatasource.allgroups; } 

    you're trying mold sample datasource that's not appropriate data model needs. implementation of data source explicitly indicating it's not set used in way you're trying use it. if understand correctly, have groups of groups?

  2. again, underlying datasource sample , sample includes 3 primary fields in data model: image, title , subtitle. through xaml databinding, sample data template (standard250x250itemtemplate in standardstyles.xaml) handling specific , narrow case.

i start laying out data model should - forget what's in sample template. day 7 of microsoft's app builder guidance includes section on working data , files, including data binding helpful you.

when master this, you'll realize question "where place code moot." there's code other takes data , assign datacontext.

for rss specifically, blog reader tutorial should since it's accessing , displaying items rss feed.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -