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

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
雷峰网
雷峰网
月光博客
月光博客
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
Security Latest
Security Latest
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
A
Arctic Wolf
Latest news
Latest news
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
F
Fortinet All Blogs
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
S
Secure Thoughts
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 【当耐特】
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
H
Help Net Security
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog

博客园 - 一一九九

Introduce to MEF (Study)- one 【wpf】AnimatedTabControl 如何显示内容 [wpf]设置Application的ICO Error: does not contain a static 'Main' method suitable for an entry point [wpf] Can you outline a story-driven process with Concordion? Your First Concordion.Net Project (Part 5)-Running Specs with Gallio Your First Concordion.Net Project (Part 4)-More Specifications! Your First Concordion.Net Project (Part 3)-Adding Specifications Your First Concordion.Net Project (Part 2)-Setting Up Visual Studio Your First Concordion.NET Project (Part 1)-What is Concordion.Net? [Specification by Example][ch5 Deriving scope from goals]-[读书笔记]-[4] [Specification by Example][ch5 Deriving scope from goals]-[读书笔记]-[3] [Specification by Example][ch5 Deriving scope from goals]-[读书笔记]-[2] [Specification by Example][ch5 Deriving scope from goals]-[读书笔记]-[1] [Specification by Example][ch4 Initiation the changes]-[读书笔记] [Specification by Example][ch3 Living documentation]-[读书笔记] [Specification by Example][ch2 key process patterns]-[读书笔记] [Specification by Example][ch1 key benefits]-[读书笔记] Resource
Binding
一一九九 · 2012-01-03 · via 博客园 - 一一九九

2012-01-03 18:26  一一九九  阅读(273)  评论()    收藏  举报

The binding code is analogous to the binding markup extension. it’s an entity in and of itself that represents the relationship between the source and the target of the data binding. The constructor for Binding accepts a path to the target. the path tells the binding how to get the target data, starting from the data context of source.

BindingOperation is  a utility class used for manipulation bindings. We use the SetBinding mthod to establish the relationship between the tab and the presenter. SetBinding takes three parameters. The first is the target of the data binding. The second is the dependecncy property on the target that we are binding to. the third parameter is the binding we just creatd.

in summary, there are three steps to create a functioning data binding:

1. Create an instance of Binding.

2. Establish the relationship between the target and the binding with BindingOperations.SetBing();

3. set the data Context on the target to the soure of the data .

Data templates

data templates are one of the two types of templates used in WPF. they provide a way to descrbe how data should be visualized in terms of UI Elements. This is different from deciding how  to render a datetime value, or formatting a telephone number.

data templates are a composition of UI elements. Many controls have properties of type DataTemplate. for example , itemsControl.ItemTemplate and GridView.CellTemplate.

sometimes it can get confusing to know which feature of WPF is appropriate in a given scenario. there’s some overlap in the things that styles, data templates, and control templates are able todo. to add to the confusion, you cn embed styles in your data templates, control templates in your styles, and so on. here are a few thoughts to help you decide what to use:

Styles are the simplest of the three, so if you are able to achieve what you want using styles, that is the best choice. Keep in mind that styles allow you to set nonvsual prperties as well.

control templates define the UI elements that compose a given control. that’s a lot more complicated than merely setting some properties. you should use control templates only when you really need to.

data templates resemble control templates in that they allow you to compose UI elements. they are often used with list controls to define how items in a list should be rendered.

Converts are classed that implement IValueConverter. The interface has two methods, Convert and ConvertBack. Convert is used when data flows from the source to the target. ConvertBack is used when data flows back to the source( in a two-way binding).

Both methods take four paramteters. The first is value , and it is the actual data  to be manipulated. The second is the type of the target data . the third typ if for general use and can be used to parameterize you converter. the fourth is the cultural information about the executing context.