views:

1096

answers:

2

Would it be possible to show an image in full screen mode using silverlight. I'm looking out for some thing like the full screen option of the flash video players.

A: 

Set System.Windows.Interop.BrowserHost.IsFullScreen = true.

radu_c
Sounds like this might not work on other runtimes than Microsoft's on Windows, so maybe not the best solution.
jfs
+4  A: 

You can set

Application.Current.Host.Content.IsFullScreen = true;

this has to be done from a mouse button event or a click, you can't force the user into full screen without some interaction on their part.

Then you'll need to scale the image. If it's in an element that scales automatically, like a Grid cell and the Grid resizes automatically (like if it's the root element on the page and the page doesn't have a width or height specified) then you're good, but otherwise you'll need to handle the Application.Current.Host.Content.FullScreenChanged event and either resize or apply a scale transform to the image or its container to make it fill the screen, and do the same when you go back to non full screen mode.

Bill Reiss