惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Vercel News
Vercel News
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
Help Net Security
Help Net Security
月光博客
月光博客
N
News and Events Feed by Topic
Cloudbric
Cloudbric
博客园 - 司徒正美
L
LangChain Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tenable Blog
The Register - Security
The Register - Security
The Hacker News
The Hacker News
I
InfoQ
The Last Watchdog
The Last Watchdog
MyScale Blog
MyScale Blog
Schneier on Security
Schneier on Security
WordPress大学
WordPress大学
小众软件
小众软件
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
宝玉的分享
宝玉的分享
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
Kaspersky official blog
L
LINUX DO - 热门话题
N
News | PayPal Newsroom
F
Fortinet All Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security @ Cisco Blogs
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
Google Online Security Blog
Google Online Security Blog
S
Schneier on Security
C
Cisco Blogs
N
News and Events Feed by Topic
V2EX - 技术
V2EX - 技术
Latest news
Latest news
PCI Perspectives
PCI Perspectives
T
The Blog of Author Tim Ferriss
P
Palo Alto Networks Blog
T
Tor Project blog
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Webroot Blog
Webroot Blog
Attack and Defense Labs
Attack and Defense Labs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

博客园 - everx

CruiseControl.net - 找到的一些文档。分享出来 【摘抄】回归测试(Regression Test) 那就来说说ASP.NET MVC中的Routing吧 ASP.NET MVC - View ASP.NET MVC - Controller(part Ⅱ) ASP.NET MVC - Controller(part Ⅰ) ASP.NET MVC - Model 学一下ASP.NET MVC C# 3.0的新特性 jQuery学习笔记(八) jQuery 学习笔记(七) SilverLight学习之路(四) Silverlight学习之路(三) - everx - 博客园 JQuery学习笔记(六) JQuery学习笔记(五) 初次使用log4net Silverlight学习之路(二) JQuery学习笔记(四) JQuery学习笔记(三)
播下silverlight的种子
everx · 2008-02-21 · via 博客园 - everx

经过这么久,终于决定学Silverlight了。还是从最基本的QuickStart开始好了

一、QuickStart part1
1、准备工作
一个典型的Sliverlight需要4个文件
a. 一个html文件,用于存放silverlight插件
b. silverlight.js文件
c. 一个XAML文件
d. 和一个用于支持html文件的js文件

2、开始
先从SDK中找到silverlight.js,然后将其插入到html页中
<script type="text/javascript" src="Silverlight.js"></script>
再创建一个createSilverlight.js,用于创建silverlight插件
<script type="text/javascript" src="createSilverlight.js"></script>
接着创建存放silverlight插件的html元素,比如div。需要声明其ID 暂且为mySilverlightPluginHost
在这个div下,插入如下脚本块
<script type="text/javascript">
        // Retrieve the div element you created in the previous step.
        var parentElement =
            document.getElementById("mySilverlightPluginHost");
       
        // This function creates the Silverlight plug-in.
        createMySilverlightPlugin();
</script>
然后再createSilverlight.js 文件中添加如下脚本:
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:'300',                // Width of rectangular region of
                                        // plug-in area in pixels.
            height:'300',               // 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:'#D6D6D6',       // Background color of plug-in.
            isWindowless:'false',       // 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:null                 // OnLoad property value --
                                        // event handler function name.
        },
        null);                          // Context value -- event handler function name.
}
好了,最后该创建silverlight的内容了
创建myxaml.xaml文件 ,由于上一步指定了这个文件名

二、QuickStart Part2
1、创建Canvas和命名空间声明
每一个XAML文件都以Canvas元素开头,就像html都以html开头一样
<Canvas
   xmlns="http://schemas.microsoft.com/client/2007"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</Canvas>

2、画一些东西
<Ellipse
    Height="200" Width="200"
    Stroke="Black" StrokeThickness="10" Fill="SlateBlue" />
这段语句画了一个圆,宽、高各200px,边框颜色为黑色,边框宽10px,填充颜色为SlateBlue

3、查看XAML内容
完成了,现在在浏览器中查看一下那个html文件,就可以预览刚刚的成果了