windows8商店应用程序开发数据绑定
2013-12-22 12:49
155 查看
1. Binding
<targetObject targetProperty="{Binding}" ...> ... </targetObject>
或
<targetObject targetProperty="{Binding [Path=]bindingSourceProperty}" ...> ... </
targetObject>
2. StaticResource
<object propertyName="{StaticResource resourceKey}" ...> ... </ object>
resourceKey 是被引用的资源的键,由资源定义时的 x:Key 或 x:Name 指定
3. TemplateBinding
<templateObject templateProperty="{TemplateBinding [Property=] sourceObjectProperty}"
...> ... </templateObject>
templateObject 是 模 板 对 象 ;templateProperty 是 模 板 对 象 的 属 性 ;Property
是 TemplateBinding 的 属 性, 用 于 指 定 被 绑 定 对 象 的 属 性, 通 常 可 省 略 不 写 ;
sourceObjectProperty 是被绑定对象的属性。
4. RelativeSource
TemplatedParent 模式通常使用于 ControlTemplate 元素定义中
<object property="{Binding RelativeSource={RelativeSource [Mode=]modeValue}}" ...>
... </object>
或
<object property="{Binding RelativeSource={RelativeSource [Mode=]
modeValue},[Path=]bindedProperty}" ...> ... </object>
Mode 是 RelativeSource 的属性,用于设置绑定模式,属性值有 Self
和 TemplatedParent。当 Mode 属性取值为 Self 时,表示元素或元素的属性是绑定源;取值为
TemplatedParent 时,表示引用 ControlTemplate 模板的元素或元素的属性是绑定源。Path 也
是 RelativeSource 的属性,用于指定被绑定的属性
<targetObject targetProperty="{Binding}" ...> ... </targetObject>
或
<targetObject targetProperty="{Binding [Path=]bindingSourceProperty}" ...> ... </
targetObject>
2. StaticResource
<object propertyName="{StaticResource resourceKey}" ...> ... </ object>
resourceKey 是被引用的资源的键,由资源定义时的 x:Key 或 x:Name 指定
3. TemplateBinding
<templateObject templateProperty="{TemplateBinding [Property=] sourceObjectProperty}"
...> ... </templateObject>
templateObject 是 模 板 对 象 ;templateProperty 是 模 板 对 象 的 属 性 ;Property
是 TemplateBinding 的 属 性, 用 于 指 定 被 绑 定 对 象 的 属 性, 通 常 可 省 略 不 写 ;
sourceObjectProperty 是被绑定对象的属性。
4. RelativeSource
TemplatedParent 模式通常使用于 ControlTemplate 元素定义中
<object property="{Binding RelativeSource={RelativeSource [Mode=]modeValue}}" ...>
... </object>
或
<object property="{Binding RelativeSource={RelativeSource [Mode=]
modeValue},[Path=]bindedProperty}" ...> ... </object>
Mode 是 RelativeSource 的属性,用于设置绑定模式,属性值有 Self
和 TemplatedParent。当 Mode 属性取值为 Self 时,表示元素或元素的属性是绑定源;取值为
TemplatedParent 时,表示引用 ControlTemplate 模板的元素或元素的属性是绑定源。Path 也
是 RelativeSource 的属性,用于指定被绑定的属性
相关文章推荐
- BITED-Windows8应用开发学习札记之三:如何在Win8应用中实现数据绑定
- [Win8]Windows8开发笔记(八):数据绑定的基础
- Windows 8 应用商店应用开发 之 应用程序的数据存储(2)应用程序存储空间
- Android开发之向应用程序界面绑定数据
- Windows 8 应用商店应用开发 之 应用程序的数据存储(2)应用程序存储空间
- [Win8]Windows8开发笔记(八):数据绑定的基础
- Windows Phone 8初学者开发—第10部分:数据绑定应用程序和透视应用程序项目模板简介
- [Win8]Windows8开发笔记(九):ListView的使用和数据绑定
- Windows Phone 8初学者开发—第10部分:数据绑定应用程序和透视应用程序项目模板简介
- Kendo UI开发教程(13): Kendo MVVM 数据绑定(二) Checked
- windows8应用开发入门之binding(绑定)
- Kendo UI开发教程(12): Kendo MVVM 数据绑定(一) attr
- 数据库应用程序开发中图像数据的存取技术
- Kendo UI开发教程(21): Kendo MVVM 数据绑定(十) Source
- Kendo UI开发教程(14): Kendo MVVM 数据绑定(三) Click
- 新时尚Windows8开发(27):根据应用程序的视图状态调整UI
- <win8>(二)实例讲解win8(XAML+C#)开发--------课程表:数据绑定
- vue开发:vue,angular,react数据双向绑定原理分析
- 自定义控件开发3---集合数据绑定控件
- JAVAWEB开发之SpringMVC详解(二)——高级开发、数据回显、参数绑定集合、图片上传、json交互、validation校验、异常处理、RESTful支持、拦截器