< Phone: phoneapplicationpage. Resources > < Shell: ApplicationBar X: Key = "Appbar0" Ismenuenabled = "True" Isvisible = "True" Mode = "Default" Opacity = "0.8" Backgroundcolor = "Black" Foregroundcolor = "White" > < Shell: applicationbariconbutton X: Name = "Hottopicsrefreshbutton" Text = "Refresh" Iconuri = "/Assets/icons/refresh.png" Click = "Hottopicsrefreshbutton_click" /> < Shell: applicationbariconbutton X: Name = "Hottopicssearchbutton" Text = "Search" Iconuri = "/Assets/icons/feature.search.png" Click = "Searchbutton_click" /> < Shell: ApplicationBar. menuitems > < Shell: applicationbarmenuitem Text = "Settings" Click = "Settingsbutton_click" /> </ Shell: ApplicationBar. menuitems > </ Shell: ApplicationBar > < Shell: ApplicationBar X: Key = "Appbar1" Backgroundcolor = "Black" Foregroundcolor = "White" Ismenuenabled = "True" Isvisible = "True" Mode = "Default" Opacity = "0.8" > < Shell: applicationbariconbutton Text = "Manage" Iconuri = "/Assets/icons/favs.png" Click = "Managesubwordsbtn_click" /> < Shell: applicationbariconbutton Text = "Refresh" Iconuri = "/Assets/icons/refresh.png" /> < Shell: applicationbariconbutton Text = "Search" Iconuri = "/Assets/icons/feature.search.png" Click = "Searchbutton_click" /> < Shell: ApplicationBar. menuitems > < Shell: applicationbarmenuitem Text = "Settings" Click = "Settingsbutton_click" /> </ Shell: ApplicationBar. menuitems > </ Shell: ApplicationBar > </ Phone: phoneapplicationpage. Resources >
In CS code:
If (Phonepivot. selectedindex = 0 ) {ApplicationBar = (Iapplicationbar) resources [ " Appbar0 " ];} Else If (Phonepivot. selectedindex = 1 ) {ApplicationBar = (Iapplicationbar) resources [ " Appbar1 " ];} If (ApplicationBar! = Null ) {ApplicationBar. backgroundcolor = System. Windows. Media. colors. Black; ApplicationBar. foregroundcolor = System. Windows. Media. colors. White ;}