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