xaml - Selected Item Pivot for Windows Phone 8.1 -


i have problem selecting item pivot in windows phone 8.1. have commandbar makes navigation between pages belonging pivot, , have programmed change in onclick selecteditem of each button , display changes each page. when start application buttons, making debug selecteditem change made , no exception display not change page. strangest thing when navigate manually between pages navigation pivot , pressed button on commandbar pages work. problem happens when start application.

it can happen ?, can solve ?, i'm little frustrated xd.

here code of pivot , command bar:

<pivot x:name="pivotmain" style="{staticresource pivotstylemain}" margin="0,0,-0.333,0" >         <pivotitem x:name="pvtmenu" header="online" datacontext="{binding groups}">             <listview                      automationproperties.automationid="itemlistviewsection3"                     automationproperties.name="items in group"                     selectionmode="none"                     isitemclickenabled="true"                     itemssource="{binding lstmenu}"                     itemtemplate="{staticresource standardtriplelineitemtemplate}"                     itemclick="itemview_itemclick"                     continuumnavigationtransitioninfo.exitelementcontainer="true">             </listview>         </pivotitem>         <pivotitem x:name="pvtmenuoffline" header="offline" datacontext="{binding groups}">             <listview                      automationproperties.automationid="itmlistviewmenuoffline"                     automationproperties.name="items in group"                     selectionmode="none"                     isitemclickenabled="true"                     itemssource="{binding lstmenuoffline}"                     itemtemplate="{staticresource standardtriplelineitemtemplatepathimage}"                                             continuumnavigationtransitioninfo.exitelementcontainer="true" itemclick="listview_itemclick">             </listview>         </pivotitem>         <pivotitem x:name="pvtinfo" header="información">             <grid>                 <grid.columndefinitions>                     <columndefinition width="*"/>                 </grid.columndefinitions>                 <grid.rowdefinitions>                     <rowdefinition height="*"/>                     <rowdefinition height="auto"/>                 </grid.rowdefinitions>                 <listview>                     <textblock height="auto" width="auto" fontsize="25"  foreground="#7d7d7d">encuéntranos en</textblock>                     <border background="{themeresource listviewitemplaceholderbackgroundthemebrush}" margin="0,9.5,0,0" grid.column="0" horizontalalignment="left">                         <image source="assets/fb.png" stretch="uniformtofill" automationproperties.name="imgfcbk" height="auto" width="300" tapped="image_tapped"/>                     </border>                     <border background="{themeresource listviewitemplaceholderbackgroundthemebrush}" margin="0,9.5,0,0" grid.column="0" horizontalalignment="left">                         <image source="assets/tw.png" stretch="uniformtofill" automationproperties.name="imgfcbk" height="auto" width="300" tapped="image_tapped_1"/>                     </border>                     <border background="{themeresource listviewitemplaceholderbackgroundthemebrush}" margin="0,9.5,0,0" grid.column="0" horizontalalignment="left">                         <image source="assets/yt.png" stretch="uniformtofill" automationproperties.name="imgfcbk" height="auto" width="300" tapped="image_tapped_2"/>                     </border>                 </listview>                 <border background="transparent" grid.column="0" grid.row="1" horizontalalignment="left" padding="10">                     <image source="assets/componetes dispositivos moviles-22.png" stretch="uniformtofill" automationproperties.name="imgfcbk" height="auto"/>                 </border>             </grid>         </pivotitem>     </pivot> </grid> <page.bottomappbar>             <commandbar>         <commandbar.primarycommands>             <appbarbutton x:name="barbtnhome" label="online" command="{binding somecommand}" isdoubletapenabled="false" isholdingenabled="false" isrighttapenabled="false" click="barbtnhome_click">                 <appbarbutton.icon>                     <bitmapicon urisource="assets/earth53.png"/>                 </appbarbutton.icon>             </appbarbutton>             <appbarbutton x:name="barbtnoffline" label="offline" command="{binding somecommand}" isdoubletapenabled="false" isholdingenabled="false" isrighttapenabled="false" click="barbtnoffline_click">                 <appbarbutton.icon>                     <bitmapicon urisource="assets/earth85.png"/>                 </appbarbutton.icon>             </appbarbutton>             <appbarbutton x:name="barbtnabout" label="info" command="{binding somecommand}" isholdingenabled="false" isdoubletapenabled="false" isrighttapenabled="false" click="barbtnabout_click">                 <appbarbutton.icon>                     <bitmapicon urisource="assets/appbar.information.circle.png"/>                 </appbarbutton.icon>             </appbarbutton>         </commandbar.primarycommands>     </commandbar> </page.bottomappbar> 

and here code behind onclick:

    private void barbtnhome_click(object sender, routedeventargs e)     {         this.pivotmain.selecteditem = this.pvtmenu;     }      private void barbtnabout_click(object sender, routedeventargs e)     {         this.pivotmain.selecteditem = this.pvtinfo;     }      private void barbtnoffline_click(object sender, routedeventargs e)     {         this.pivotmain.selecteditem = this.pvtmenuoffline;     } 

much appreciate help.

user selectedindex instead of selecteditem.

private void barbtnhome_click(object sender, routedeventargs e) {     this.pivotmain.selectedindex = 0; }  private void barbtnabout_click(object sender, routedeventargs e) {     this.pivotmain.selectedindex = 1; }  private void barbtnoffline_click(object sender, routedeventargs e) {     this.pivotmain.selectedindex = 2; } 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -