Skip to main content
Home Forums Silverlight Design Video and Media I would like to play full screen as soon as I hit the button
4 replies. Latest Post by MawashiKid on October 31, 2009.
(0)
banderas...
Member
9 points
56 Posts
10-31-2009 5:10 PM |
hello I created mediaplayer with blend 3 everything works when you hit a hyperlink I created to a function howevever I would like when you
hit the hyperlink button the mediaplayer plays fullscreen automatically and it is takes the whole screen of the computer can anyone help me please thank you
MawashiKid
595 points
111 Posts
10-31-2009 6:34 PM |
Hi,
private void btnHyperlink_Click(object sender, RoutedEventArgs e){ ToggleFullScreen();}public void ToggleFullScreen(){ Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen}
If that answers your question please "Mark as an answer" Thank you.
10-31-2009 6:40 PM |
Ouups...I forgot the ;private void btnHyperlink_Click(object sender, RoutedEventArgs e){ ToggleFullScreen();}public void ToggleFullScreen(){ Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen;}
--------------------------------------------------------------
The following code should also do the the job
private void btnHyperlink_Click(object sender, RoutedEventArgs e) { Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen; }
10-31-2009 7:14 PM |
very nice thank you one quick question I would like the mediaplayer to fit the whole screen I'm sorry I'm new to expression when you click the button now it makes to full screen but I want the whole computer screen fill with media player can you help me please
10-31-2009 8:56 PM |
I'm not exactly sure about the exact layout you're using (buttons Like Play, Reverse, Stop...)but you could try adding a "Stretch=Fill" attribute to yourMediaElement.Example:<MediaElement x:Name="myVideoPlayer" Source="http://localhost/showtime/myvideo.wmv" Stretch="Fill"/>Also depending on screen resolution, displaying the video in full screen may have a certainimpact on quality... but I'll skip on that one... cause I don't believe it's really the issue of your question. ;)