Silverlight中的全屏相关.

http://www.cnblogs.com/gugunet/archive/2008/06/24/1228923.html

 

在sl中实现全屏很简单,只要在需要全屏的页面:
1.命名空间:

using System.Windows.Interop;
2.在事件中写入:
Content contentObj = App.Current.Host.Content;
contentObj.IsFullScreen 
= !contentObj.IsFullScreen;
这样就行了,如果想在全屏发生/取消时发生一些特定的动作,那么:
在构造函数中写入:
App.Current.Host.Content.FullScreenChanged += new EventHandler(Content_FullScreenChanged);
然后在Content_FullScreenChanged中写入对应的东西:
private void Content_FullScreenChanged(object sender, EventArgs e)
{
    
//一些代码
}
就OK了...

posted on 2009-03-03 18:52  wmt  阅读(135)  评论(0编辑  收藏  举报

导航