技术开发 频道

Silverlight 1.0中实现全屏布局调整


【IT168技术文档】

  全屏对于用户体验还是很重要的,虽然在网上已经有讲如何实现全屏的文章了,但不是很全面,也没有讲到onFullScreenChanged事件,在此就当作个学习笔记。

  创建Silverlight插件的代码在此就不详细讲解了,如果大家有啥不清楚的,可以去看silverlight 1.0 SDK中的QuickStart教程。我们首先来添加一个onLoad事件的事件处理程序,叫做myLoad,如下面红色代码所示:
function createMySilverlightPlugin() { Silverlight.createObject( "myxaml.xaml", // Source property value. parentElement, // DOM reference to hosting DIV tag. "mySilverlightPlugin", // Unique plug-in ID value. { // Per-instance properties. width:'400', // Width of rectangular region of // plug-in area in pixels. height:'400', // Height of rectangular region of // plug-in area in pixels. inplaceInstallPrompt:false, // Determines whether to display // in-place install prompt if // invalid version detected. background:'#00FFFFFF', // Background color of plug-in. isWindowless:'true', // Determines whether to display plug-in // in Windowless mode. framerate:'24', // MaxFrameRate property value. version:'1.0' // Silverlight version to use. }, { onError:null, // OnError property value -- // event handler function name. onLoad:myLoad // OnLoad property value -- // event handler function name. }, null); // Context value -- event handler function name. }
  然后我们添加对应的myLoad函数:
function myload(control,context,root) { control.Content.OnFullScreenChange = onFullScreenChanged; }
0
相关文章