更新Silverlight ctp到Silverlight beta 1.0

下面是我更新Silverlight ctp到Silverlight beta 1.0的一个纪录,希望对各位同学有帮助。
1、卸载Silverlight ctp 和sdk以及VS template
3、安装Microsoft Silverlight 1.0 Beta SDK ( [url]http://go.microsoft.com/fwlink/?linkid=89144&clcid=0x409[/url]).同时安装 VS template
4、从C:\Program Files\Microsoft SDKs\Silverlight1.0SDK  file from拷贝 Silverlight.js替换aghost.js :
<script type="text/javascript" src=" Silverlight.js"></script>
 5、用Sys.Silverlight.createObject() 替换aghost(). 调用参数也作了相应修改:
WPF/E:    new agHost(
             "WpfeControlHost",  // DIV tag id.
             "WpfeControl",      // WPF/E control id.
             "400px",            // Width of rectangular region of WPF/E control in pixels.
             "100px",            // Height of rectangular region of WPF/E control in pixels.
             "#D6D6D6",          // Background color of rectangular region of WPF/E control.
             null,               // SourceElement property value.
             "HelloWorld.xaml",  // Source property value.
             "false",            // WindowlessMode property value.
             "30",               // MaxFrameRate property value.
             'myErrorHandler');  // OnError property value -- notice use of single quotes.
Silverlight:
Sys.Silverlight.createObject(
        "HelloWorld.xaml",             // Source property value.
        WpfeControlHost,               // DOM reference to hosting DIV tag.
        "WpfeControl",                 // Unique control id value.
        {                              // Control properties.
            width:'400',               // Width of rectangular region of control in pixels.
            height:'100',              // Height of rectangular region of control in pixels.
            inplaceInstallPrompt:false,// Determines whether to display in-place install prompt if invalid version detected.
            background:'#D6D6D6',      // Background color of control.
            isWindowless:'false',      // Determines whether to display control in Windowless mode.
            framerate:'30',            // MaxFrameRate property value.
            version:'0.9'              // Control version to use.
        },
        {
            onError:'myErrorHandler',  // OnError property value -- event handler function name.
            onLoad:null                // OnLoad property value -- event handler function name.
        },
        null);                         // Context value -- event handler function name.
一些参数和参数的顺序都发生了变化。首先Div tag的没有引号的. 其次只要传递五个参数,第四、五个参数是个javascript object有多个参数。
Tips
1、搜索Xaml文件,去除所有的javascript实例,这个修改主要是现在Silverlight支持多种语言了,不仅仅是Javascript,而Xaml只是描述界面的。
例如:
<Canvas xmlns=" [url]http://schemas.microsoft.com/client/2007[/url]"
xmlns:x=" [url]http://schemas.microsoft.com/winfx/2006/xaml[/url]"
Loaded="javascript:root_Loaded"
x:Name="root" 
 ……
</Canvas>
替换成
<Canvas xmlns=" [url]http://schemas.microsoft.com/client/2007[/url]"
xmlns:x=" [url]http://schemas.microsoft.com/winfx/2006/xaml[/url]"
Loaded="root_Loaded"
x:Name="root" 
 ……
</Canvas>
2、事件  MouseMove event 作了些修改. 获取x、y坐标现在改成了: args.GetValue("X")
3、   CreateFromXaml method 已经不是Silverlight control object 的, 属于 content object. 因此要wpfeControl. content.createFromXaml("...").替换 wpfeControl.createFromXaml("...")
5、MIX07会议中微软同时发布Silverlight 1.0的Beta测试版与Silverlight 1.1的Alpha测试版。1.0 Beta版已提供Go Live授权,1.1版本还是Alpha,功能虽然强大很多,但是风险挺大。企业用Silverlight 1.0测试版开发产品,可直接上线使用。2007年夏天微软将发布1.0正式版。





本文转自 张善友 51CTO博客,原文链接:http://blog.51cto.com/shanyou/74293,如需转载请自行联系原作者
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值