Silverlight 2 Sidebar Gadget

。_饼干妹妹 提交于 2019-12-04 19:40:42

问题


How do you display a Silverlight 2.0 application in a Vista Sidebar gadget? Whenever I load a gadget with the standard Silverlight 2 object tag, I get the no-silverlight default content instead of the app. So, what's the trick to allowing it to run?

This is how I am currently trying to pull it off:

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
    <title>Silverlight Test</title>
    <style type="text/css">
      body {
        margin: 0;
        width: 130px;
      }
    </style>
  </head>

  <body>
  <object data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%">
            <param name="source" value="GTest.xap"/>            
            <param name="background" value="transparent" />
            <param name="minRuntimeVersion" value="2.0.31005.0" />
            <param name="autoUpgrade" value="true" />
            <param name="windowless" value="true" />
            Get Silverlight
        </object>
  </body>

  </html>

Is there a setting I can use in IE that affects the sidebar so it will allow Silverlight to execute?

Even if I can get it working just on my computer, that would be a good start.


回答1:


It seems with the release version of Silverlight 2 the source parameter changed and has to be a URI - see this thread from the Silverlight forums: http://silverlight.net/forums/p/30968/99824.aspx




回答2:


Just to clarify for future generations:

Changing the source value to "x-gadget://ClientBin/GTest.xap" did the trick.



来源:https://stackoverflow.com/questions/251389/silverlight-2-sidebar-gadget

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