Silverlight 全屏与全屏事件

来源:互联网 发布:葫芦娃淘宝 编辑:程序博客网 时间:2024/04/26 21:06
 
  public MainPage()        {            InitializeComponent();            Application.Current.Host.Content.FullScreenChanged += new EventHandler(Content_FullScreenChanged);        }        void Content_FullScreenChanged(object sender, EventArgs e)        {            if (isFull)            {                MessageBox.Show("全屏");                isFull = false;            }            else            {                MessageBox.Show("退出全屏");                isFull = true;            }        }        bool isFull = true;        private void button1_Click(object sender, RoutedEventArgs e)        {            SilverlightHost sh = new SilverlightHost();            Content content = sh.Content;            if (isFull)            {                content.IsFullScreen = isFull;            }            else            {                content.IsFullScreen = isFull;            }        }