c# - How to remove a AppBarButton from a CommandBar -


i have commandbar set xaml:

<page.bottomappbar>     <commandbar x:name="maincommandbar"                 verticalalignment="top"                 margin="0">          <!--toolbar-->         <appbarbutton x:name="appbarbuttonscan"                       label="scan"                       click="appbarbutton_click"                       icon="scan" />          <appbarbutton x:name="appbarbuttonstop"                       label="stop"                       click="appbarbutton_click"                       isenabled="false"                       visibility="collapsed"                       icon="stop" />          <appbarbutton x:name="appbarbuttonpair"                       label="pair"                       click="pairbutton_click"                       isenabled="false"                       icon="link" />     </commandbar> </page.bottomappbar> 

i remove button code. tried doing:

maincommandbar.primarycommands.remove( appbarbuttonscan ); maincommandbar.invalidatearrange(); 

and

maincommandbar.primarycommands.remove( appbarbuttonscan ); maincommandbar.invalidatemeasure(); 

and

maincommandbar.primarycommands.remove( appbarbuttonscan ); maincommandbar.invalidatearrange(); maincommandbar.invalidatemeasure(); 

and

maincommandbar.primarycommands.remove( appbarbuttonscan ); maincommandbar.updatelayout(); 

what see button getting collapsed (or removed) commandbar not update layout, i.e. there empty space left removed button was.

any idea how solve that?


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo