my problem is quite simple: when user changes selection in a ListBox, I need my app to go to fullscreen mode, but I need to change the displayed page. I use Silverlight 4
private void MainListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
PresentationPage currentPresentationPage = new PresentationPage();
App.Current.RootVisual = currentPresentationPage;
App.Current.Host.Content.IsFullScreen = true;
}
When the code above is executed, the app goes to fullscreen, but the Page does not change, it only resizes. Can anybody tell me what’s wrong with that code? Thanks
You can’t change
Application.RootVisualafter it is assigned. What you need to do is include a panel that you can change it’s content and make that panel yourRootVisual.Then in your App’s
Startupevent do something like so.