Sunday 15 August 2010

xaml - Why am I getting a XamlParseException here? -



xaml - Why am I getting a XamlParseException here? -

with xaml:

<page.bottomappbar> <appbar x:name="bottomappbar" padding="10,0,10,0"> <grid> <stackpanel orientation="horizontal" horizontalalignment="left"> <button style="{staticresource browsephotosappbarbuttonstyle}" click="btnopenimgfiles_click"/> <button style="{staticresource openappbarbuttonstyle}" click="btnopenmap_click"/> </stackpanel> <stackpanel orientation="horizontal" horizontalalignment="right"> <button style="{staticresource saveappbarbuttonstyle}" click="btnsavemap_click"/> </stackpanel> </grid> </appbar> </page.bottomappbar>

(which adapted markup found online) got "windows.ui.xaml.markup.xamlparseexception"

looking @ this, figured should appbarbutton instead of button, changed them that...but i'm still getting same err msg. because there's no such thing "browsephotosappbarbuttonstyle" (i can't find list of valid values that) or...???

yes. it's button styles based on legacy windows 8 code. if you're targeting windows 8.1 should utilize appbarbuttons rather buttons. i'd set them in commandbar rather layout out own grid in appbar.

if browsephotosappbarbuttonstyle isn't specific sample got available in standardstyles.xaml file included windows 8 templates. file included big number of commented out button styles uncomment needed.

here's how you'd set in windows 8.1 app. simplicity didn't hook click handlers, , may want update label , automation names:

<page.bottomappbar> <appbar x:name="bottomappbar" padding="10,0,10,0"> <commandbar> <commandbar.secondarycommands> <appbarbutton icon="browsephotos" label="browse" automationproperties.name="browse photos" /> </commandbar.secondarycommands> <commandbar.primarycommands> <appbarbutton icon="openfile" label="open" automationproperties.name="open file"/> <appbarbutton icon="save" label="save" automationproperties.name="save file"/> </commandbar.primarycommands> </commandbar> </appbar> </page.bottomappbar>

see adding app bars (xaml) more details.

xaml windows-store-apps xamlparseexception

No comments:

Post a Comment