Eric
Eric

Reputation: 1268

Change SystemTray.IsVisible during runtime (code)? Windows Phone 7 Related

Can I disable SystemTray.IsVisible during runtime so my consumers can hide the systemtray or show it when they want to?

Upvotes: 0

Views: 905

Answers (2)

purplecabbage
purplecabbage

Reputation: 495

Yes, you can. Try this anywhere ... Note too that this also applies to WP8

PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (frame != null)
{
    PhoneApplicationPage page = frame.Content as PhoneApplicationPage;

    if (page != null)
    {
        SystemTray.SetIsVisible(page, false);
    }
}

Upvotes: 0

Claus Jørgensen
Claus Jørgensen

Reputation: 26346

Try it and see instead of asking? It takes longer to write the question, than to write the code for it.

But I would recommend against it. The SystemTray automatically hides itself (but keep it's allocated 12 pixels), and only show when you tap at the top.

Changing it's Opacity, and adjusting the Background to match that of your app, it's a much better idea.

Upvotes: 1

Related Questions