Skip to main content

Microsoft Silverlight

Answered Question I would like to play full screen as soon as I hit the buttonRSS Feed

(0)

banderastyle28
banderas...

Member

Member

9 points

56 Posts

I would like to play full screen as soon as I hit the button

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
MawashiKid

Member

Member

577 points

107 Posts

Re: I would like to play full screen as soon as I hit the button

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.

MawashiKid
MawashiKid

Member

Member

577 points

107 Posts

Answered Question

Re: I would like to play full screen as soon as I hit the button

 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;
}

 

banderastyle28
banderas...

Member

Member

9 points

56 Posts

Re: Re: I would like to play full screen as soon as I hit the button

 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

MawashiKid
MawashiKid

Member

Member

577 points

107 Posts

Re: Re: I would like to play full screen as soon as I hit the button

Hi,

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 your
MediaElement.
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 certain
impact on quality... but I'll skip on that one... cause I don't believe it's really the issue of your question. ;)

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities