0

Appbar works great but when I use

this.Content = new PAGE(Constructor1, Constructor1, Constructor1);

to navigate to other page....App bar doesn't show up....:|

Same Xaml works for other page what I am navigating from UI...(Right click>navigate to) but not for when I use the code.....

 <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">
          <shell:ApplicationBarIconButton IconUri="/Images/appbar.cancel.rest.png" Text="Cancel"/>
          </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>

1 Answers1

0

Wouldn't changing this.Content replace the page's content, including the AppBar, by design?

I use NavigationService to navigate between pages. If I have an AppBar I just recreate it on each page.

Alternately, redesign your layout so that the content you are replacing does not include the AppBar (e.g. use a stackpanel or grid to hold your content with the AppBar higher up in the hierarchy).

pumpkinszwan
  • 1,312
  • 11
  • 21
  • Thanks for your reply, I have tried your suggestion but having some difficulties using Navigation Service... I am not sure how to use Navigation and send constructor to next page. – user2378275 May 14 '13 at 12:37
  • I can't remember where I got it (I think from StackOverflow), but I am using a little class called NavigationExtensionsModule, which lets me send any data (e.g. a complex class) between pages in Windows Phone. Would that help you? Search around here for how to pass data between pages and you should find it. – pumpkinszwan May 14 '13 at 13:03
  • Try this: http://stackoverflow.com/questions/13654379/how-do-i-pass-non-string-parameters-between-pages-in-windows-phone-8 – pumpkinszwan May 14 '13 at 13:04