To view the silverlight app in fullscreen mode(F11)

心不动则不痛 提交于 2019-12-31 03:54:11

问题


Is there any way to load my silverlight app in F11 mode directly? I have used

window.open(url, '_self',
    'toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=no,fullscreen=yes',
    'true');
HtmlPage.window.invoke("launchPage",url);

But the problem is that two instances of my app are opened. One in normal screen and the other in fullscreen.

I have tried

App.Current.Host.Content.IsFullScreen = true; 

in the constructor of the App.xaml

Still its not working. :( Where am I going wrong??


回答1:


running a Silverlight application automatically in full-screen is not possible because of security restriction. It is like the following...

  1. You have opened your banks login page in a Firefox tab. This is your current tab.
  2. You are opening a malicious silverlight application on another tab.
  3. The malicious silverlight application loads and creates a full-screen that exactly matches your bank's login page.
  4. You are talking to someone while the silverlight application loads. (Your eye is not on screen) So you missed the fullscreen message that pops up.
  5. Now when you look at the computer screen you see your bank login page that is actually a fullscreen page of the silverlight application that matches your bank's login page.
  6. You enter your user name and password...and
  7. When you click login the malicious application has got everything it wanted.

This is not only for Silverlight. It is a restriction that SHOULD BE THERE WITH EVERY ACTIVEX CONTROL UNTIL THIS PROBLEM IS SOLVED.

What you are doing with javascript is you are opening a new pop up window without menubar, addressbar etc. It is not a replacement of F11. And to my experience most of the users hate automatic poping up. And most modern browsers will block them anyway.

The best way is to tell the user she needs to view your application on fullscreen and LET HER DECIDE INSTEAD OF FORCING IT.



来源:https://stackoverflow.com/questions/1164078/to-view-the-silverlight-app-in-fullscreen-modef11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!