Friday, 15 August 2014

windows phone 8 - WP8.1 Appbar HideCommands Issue -



windows phone 8 - WP8.1 Appbar HideCommands Issue -

i writing wp8.1 app using winjs , navigation template in visual studio. have appbar in app , when navigate different pages utilize hidecommands/showcommands customize appbar commands appropriate page. issue commands hidden not hidden before commands shown shown. creates momentary flash of buttons hidden.

var commands = [appbar.wincontrol.getcommandbyid("commanda"), appbar.wincontrol.getcommandbyid("commandb"), appbar.wincontrol.getcommandbyid("commandc")]; appbar.wincontrol.hidecommands(commands); appbar.wincontrol.showcommands("commandd");

any help appreciated.

same thing happened me. used think having 1 appbar improve creating 1 every page had same approach did using showonlycommands. worked fine on windows 8 (& 8.1) not work expected in winphone 8.1

so ended doing having appbar markup in every page needed appbar.

<div data-win-control="winjs.ui.appbar"></div>

i have code show/hide commands appbars using showonlycommands method has worked no problems ever since.

one tip of advice: showonlycommands can receive array of either commads id (as string) or appbarcommands themselves. found later worked expected. had little issues ids

windows-phone-8 winjs appbar

No comments:

Post a Comment