c# - Change Page when entering fullscreen mode -


My problem is quite simple: when the user changes the selection in a list box, let me go to fullscreen mode App is needed, but I need to change the displayed page I am using Silverlight 4

  Private Zero MainListBox_SelectionChanged (Object Sender, SelectionChangedEventArgs E) {PresentationPage currentPresentationPage = new PresentationPage () ; App.Current.RootVisual = Current presentation page; App.Current.Host.Content.IsFullScreen = True; }  

The above code is executed, the app goes to the whole screen, but the page does not change, it only resizes the shape Can someone tell me that the code What's wrong in Thanks

You can not change it after Application.RootVisual . What do you need to do, which includes a panel that you can change your content and make that panel your own RootVisual .

  Private Zero MainListBox_SelectionChanged (Object Sender, SelectionChangedEventArgs e) {Presentation Page Present Presentation Page = New Presentation Page (); (In the form of App.Current.RootVisual Panel). Children clean (); (App.Corrent.RootVisual Panel) Children Add (current presentation page); App.Current.Host.Content.IsFullScreen = True; }  

Then do something like this in your app's startup event.

  panel grid = new grid (); Grid children. Add (New Home Page); App.Current.RootVisual = Grid;  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -