<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head id="Head"><title>一步一步学Silverlight 2系列(11):数据绑定 - TerryLee's Tech Space - 博客园</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta id="metaKeywords" name="keywords" content="Silverlight,一步一步学Silverlight,2系列,11,数据绑定"><meta name="description" content="Silverlight2Beta1版本发布了,无论从Runtime还是Tools都给我们带来了很多的惊喜,如支持框架语言VisualBasic,VisualC#,IronRuby,Ironpython,对JSON、WebService、WCF以及Sockets的支持等一系列新的特"><link id="CommondCss" type="text/css" rel="stylesheet" href="%EF%BC%8811%EF%BC%89%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%AA%E8%A7%A3%E5%86%B3%EF%BC%9A%E6%95%B0%E6%8D%AE%E7%BB%91%E5%AE%9A_files/common.css"><link id="SecondaryCss" type="text/css" rel="stylesheet" href="%EF%BC%8811%EF%BC%89%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%AA%E8%A7%A3%E5%86%B3%EF%BC%9A%E6%95%B0%E6%8D%AE%E7%BB%91%E5%AE%9A_files/customcss.css"><link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/Terrylee/rss">
<script src="%EF%BC%8811%EF%BC%89%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%AA%E8%A7%A3%E5%86%B3%EF%BC%9A%E6%95%B0%E6%8D%AE%E7%BB%91%E5%AE%9A_files/common.js" type="text/javascript"></script>
<style>
td { font-size: 12px }
.commentTextBox
{
font-family : Verdana;
font-size: 13px;
}
a.blue:visited,
a.blue:active,
a.blue:link,
a.blue:hover
{
color:blue;
}
</style><style>.userData { BEHAVIOR: url(#default#userdata) }
</style></head><body>
<form name="Form1" method="post" action="Silverlight2-step-by-step-part11-Data-Binding.html" onsubmit="javascript:return WebForm_OnSubmit();" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['Form1'];
if (!theForm) {
theForm = document.Form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<script src="%EF%BC%8811%EF%BC%89%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%AA%E8%A7%A3%E5%86%B3%EF%BC%9A%E6%95%B0%E6%8D%AE%E7%BB%91%E5%AE%9A_files/WebResource.js" type="text/javascript"></script>
<script language="JavaScript">
function ctlent(evt,id)
{
if(evt.ctrlKey && evt.keyCode == 13)
{
try
{
TempSave(id);
}
catch(ex)
{
}
finally
{
__doPostBack('AjaxHolder$PostComment$btnSubmit','')
}
}
}</script>
<script language="JavaScript">function SetReplyAuhor(author){document.getElementById('AjaxHolder_PostComment_tbComment').value+="@"+author+"\n";document.getElementById('AjaxHolder_PostComment_tbComment').focus();return false}</script>
<script src="%EF%BC%8811%EF%BC%89%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%AA%E8%A7%A3%E5%86%B3%EF%BC%9A%E6%95%B0%E6%8D%AE%E7%BB%91%E5%AE%9A_files/ScriptResource_002.js" type="text/javascript"></script>
<script src="%EF%BC%8811%EF%BC%89%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%AA%E8%A7%A3%E5%86%B3%EF%BC%9A%E6%95%B0%E6%8D%AE%E7%BB%91%E5%AE%9A_files/ScriptResource_003.js" type="text/javascript"></script>
<script src="%EF%BC%8811%EF%BC%89%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%AA%E8%A7%A3%E5%86%B3%EF%BC%9A%E6%95%B0%E6%8D%AE%E7%BB%91%E5%AE%9A_files/ScriptResource.js" type="text/javascript"></script>
<script src="%EF%BC%8811%EF%BC%89%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%AA%E8%A7%A3%E5%86%B3%EF%BC%9A%E6%95%B0%E6%8D%AE%E7%BB%91%E5%AE%9A_files/js.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
<div id="header">
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/Terrylee/">TerryLee's Tech Space</a></h1>
<p id="tagline">TerryLee技术专栏</p></div>
<div id="main">
<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('AjaxHolder$scriptmanager1', document.getElementById('Form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tAjaxHolder$UpdatePanel1'], [], [], 90);
//]]>
</script>
<div class="post">
<h2>
<a id="AjaxHolder_ctl01_TitleUrl" href="http://www.cnblogs.com/Terrylee/archive/2008/03/08/Silverlight2-step-by-step-part11-Data-Binding.html">一步一步学Silverlight 2系列(11):数据绑定</a>
</h2>
<div class="postText"><h2>概念</h2> <p>Silverlight
2 Beta 1版本发布了,无论从Runtime还是Tools都给我们带来了很多的惊喜,如支持框架语言Visual Basic, Visual
C#, IronRuby, Ironpython,对JSON、Web
Service、WCF以及Sockets的支持等一系列新的特性。《一步一步学Silverlight
2系列》文章带您快速进入Silverlight 2开发。</p> <p>本文为系列文章第十一篇,主要介绍Silverlight 2中的数据绑定。</p> <h2>数据绑定模式</h2> <p>在Silverlight 2中,支持三种模式的数据绑定。</p> <p>1.OneTime:一次绑定,在绑定创建时使用源数据更新目标,适用于只显示数据而不进行数据的更新。</p> <p>2.OneWay:单向绑定,在绑定创建时或者源数据发生变化时更新到目标,适用于显示变化的数据。</p> <p>3.TwoWay:双向绑定,在任何时候都可以同时更新源数据和目标。</p> <p><a href="http://silverlight.net/blogs/jesseliberty/">Jesse Liberty</a>举
的例子非常的形象,使用Silverlight开发一个在线书店,显示书籍的书名、作者等信息,使用OneTime模式,这些数据一般不会发生变化的;显
示价格信息时使用OneWay模式,因为管理员可能会在一天内调整价格;显示书籍的剩余数量时用TwoWay模式,数量随着用户的订购会随时发生变化,即
目标和源数据都要进行更新。</p> <h2>简单数据绑定</h2> <p>在本示例中我们将做一个简单的数据绑定,用来显示用户信息,XAML如下:</p><pre class="code"><span style="color: blue;"><</span><span style="color: rgb(163, 21, 21);">Grid </span><span style="color: red;">x</span><span style="color: blue;">:</span><span style="color: red;">Name</span><span style="color: blue;">="LayoutRoot" </span><span style="color: red;">Background</span><span style="color: blue;">="#46461F">
<</span><span style="color: rgb(163, 21, 21);">Grid.RowDefinitions</span><span style="color: blue;">>
<</span><span style="color: rgb(163, 21, 21);">RowDefinition </span><span style="color: red;">Height</span><span style="color: blue;">="160"></</span><span style="color: rgb(163, 21, 21);">RowDefinition</span><span style="color: blue;">>
<</span><span style="color: rgb(163, 21, 21);">RowDefinition </span><span style="color: red;">Height</span><span style="color: blue;">="40"></</span><span style="color: rgb(163, 21, 21);">RowDefinition</span><span style="color: blue;">>
<</span><span style="color: rgb(163, 21, 21);">RowDefinition </span><span style="color: red;">Height</span><span style="color: blue;">="40"></</span><span style="color: rgb(163, 21, 21);">RowDefinition</span><span style="color: blue;">>
</</span><span style="color: rgb(163, 21, 21)
没有合适的资源?快使用搜索试试~ 我知道了~
(1-20)一步一步学习silverlight2 beta1打包(TerryLee)
共586个文件
js:197个
gif:134个
png:69个
需积分: 10 48 下载量 149 浏览量
2008-08-02
11:12:02
上传
评论
收藏 7.38MB RAR 举报
温馨提示
TerryLee大侠的一步一步学习silverlight2 beta1教程打包,从他的blog上弄下来的,方便学习,有兴趣学习sliverlight的可以下载,注意这个教程是基于beta1版本的,和beta2以及即将发布的正式版差别较大,不过还是很好的一个东西
资源推荐
资源详情
资源评论
收起资源包目录
(1-20)一步一步学习silverlight2 beta1打包(TerryLee) (586个子文件)
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
customcss.css 8KB
netError.css 2KB
netError.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
common.css 2KB
TerryLee_Silverlight2_0001_thumb.gif 49KB
TerryLee_Silverlight2_0058_thumb.gif 39KB
TerryLee_Silverlight2_0057_thumb.gif 38KB
TerryLee_Silverlight2_0056_thumb.gif 38KB
TerryLee_Silverlight2_0055_thumb.gif 36KB
TerryLee_Silverlight2_0045_thumb.gif 35KB
TerryLee_Silverlight2_0048_thumb.gif 35KB
TerryLee_Silverlight2_0054_thumb.gif 35KB
TerryLee_Silverlight2_0053_thumb.gif 35KB
TerryLee_Silverlight2_0049_thumb_1.gif 34KB
TerryLee_Silverlight2_0029_thumb.gif 34KB
TerryLee_Silverlight2_0017_thumb.gif 33KB
TerryLee_Silverlight2_0012_thumb.gif 33KB
TerryLee_Silverlight2_0046_thumb.gif 33KB
TerryLee_Silverlight2_0028_thumb.gif 33KB
TerryLee_Silverlight2_0047_thumb_1.gif 33KB
TerryLee_Silverlight2_0021_thumb.gif 33KB
TerryLee_Silverlight2_0007_thumb.gif 33KB
TerryLee_Silverlight2_0051_thumb.gif 32KB
TerryLee_Silverlight2_0043_thumb.gif 32KB
TerryLee_Silverlight2_0011_thumb_1.gif 32KB
TerryLee_Silverlight2_0044_thumb.gif 32KB
TerryLee_Silverlight2_0042_thumb.gif 32KB
TerryLee_Silverlight2_0019_thumb.gif 32KB
TerryLee_Silverlight2_0038_thumb.gif 32KB
TerryLee_Silverlight2_0009_thumb_1.gif 32KB
TerryLee_Silverlight2_0041_thumb.gif 31KB
TerryLee_Silverlight2_0014_thumb.gif 31KB
TerryLee_Silverlight2_0036_thumb.gif 31KB
TerryLee_Silverlight2_0027_thumb.gif 31KB
TerryLee_Silverlight2_0015_thumb.gif 30KB
TerryLee_Silverlight2_0035_thumb.gif 30KB
TerryLee_Silverlight2_0023_thumb.gif 30KB
TerryLee_Silverlight2_0037_thumb.gif 30KB
TerryLee_Silverlight2_0024_thumb.gif 30KB
TerryLee_Silverlight2_0025_thumb.gif 30KB
TerryLee_Silverlight2_0026_thumb.gif 29KB
TerryLee_Silverlight2_0034_thumb.gif 29KB
TerryLee_Silverlight2_0033_thumb.gif 29KB
TerryLee_Silverlight2_0032_thumb.gif 29KB
TerryLee_Silverlight2_0030_thumb.gif 28KB
TerryLee_Silverlight2_0031_thumb.gif 28KB
TerryLee_Silverlight2_0052_thumb.gif 24KB
TerryLee_Silverlight2_0002_thumb.gif 21KB
TerryLee_Silverlight2_0008_thumb_1.gif 21KB
TerryLee_Silverlight2_0003_thumb_1.gif 20KB
TerryLee_Silverlight2_0004_thumb.gif 20KB
TerryLee_Silverlight2_0013_thumb.gif 18KB
TerryLee_Silverlight2_0006_thumb.gif 18KB
TerryLee_Silverlight2_0018_thumb.gif 17KB
TerryLee_Silverlight2_0050_thumb.gif 16KB
TerryLee_Silverlight2_0016_thumb.gif 16KB
TerryLee_Silverlight2_0020_thumb.gif 15KB
TerryLee_Silverlight2_0010_thumb_1.gif 13KB
TerryLee_Silverlight2_0039_thumb.gif 10KB
TerryLee_Silverlight2_0005_thumb_1.gif 10KB
TerryLee_Silverlight2_0040_thumb.gif 7KB
Tree.GIF 4KB
lhj_cauc.gif 2KB
lhj_cauc.gif 2KB
lhj_cauc.gif 2KB
lhj_cauc.gif 2KB
共 586 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
litingli
- 粉丝: 256
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功