TemplateBinding:TemplateBinding是一个Markup Extension

1: 不适用在frezable property、controltemplate trigger、 two way binding、 value converter、only support Dependent Property。其实TemplateBinding是下面Text Binding的short cut。TemplateBinding有limitation,只能1way binding 到使用ControlTemplate的 Parent Control

2:如果需要2way binding, 或者需要使用到value converter时,在使用ControlTemplate style control的时候,要用普通Binidng,可以使用RelativeSource{RelativeSource TemplatedParent}

3: Optimized Binding for controlTemplate

TemplatedParent: Full binding construct using RelativeSource

TemplateBinding vs TemplatedParent【PluraSight】的更多相关文章

  1. Custom ReadOnlyProperty【PluraSight】

    Limited functionality: Not settable No data binding No validation No animation No Inheritance When t ...

  2. UserControl和CustomControl基础【PluraSight】

    UserControl UserControl实际上就是ContentControl,xaml里<UserControl></UserControl>tag之间包含的实际就是后 ...

  3. 【WPF】创建基于模板的WPF控件(经典)

    原文:[WPF]创建基于模板的WPF控件(经典) WPF可以创建两种控件,它们的名字也很容易让人混淆:用户控件(User Control)和定制控件(Customer Control),之所以如此命名 ...

  4. 【Win10】【Win2D】实现控件阴影效果

    学过 WPF 的都知道,在 WPF 中,为控件添加一个阴影效果是相当容易的. <Border Width="100" Height="100" Backg ...

  5. 【WPF】给TextBox添上Label

    原文:[WPF]给TextBox添上Label 引言     在客户端开发中,要说出现频率大的控件,必定有TextBox的身影.然而在TextBox的旁边通常得有个基友Label,形影不离.为此,我们 ...

  6. WPF之Binding【转】

    WPF之Binding[转] 看到WPF如此之炫,也想用用,可是一点也不会呀. 从需求谈起吧: 首先可能要做一个很炫的界面.见MaterialDesignInXAMLToolKit. 那,最主要的呢, ...

  7. Python高手之路【六】python基础之字符串格式化

    Python的字符串格式化有两种方式: 百分号方式.format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存.[PEP-3101] This ...

  8. 【原】谈谈对Objective-C中代理模式的误解

    [原]谈谈对Objective-C中代理模式的误解 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 这篇文章主要是对代理模式和委托模式进行了对比,个人认为Objective ...

  9. 【原】FMDB源码阅读(三)

    [原]FMDB源码阅读(三) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 FMDB比较优秀的地方就在于对多线程的处理.所以这一篇主要是研究FMDB的多线程处理的实现.而 ...

随机推荐

  1. 【JavaScript学习笔记】画图

    <!DOCTYPE HTML> <html> <head> <script type="text/javascript"> var ...

  2. [转] gc tips(2)

    原文地址:http://kevincao.com/2011/08/actionscript-garbage-collection-1/ 谈谈ActionScript垃圾回收(上) 在<给AS程序 ...

  3. Android点击按钮实现全屏的代码

    package com.hsx.test; import java.lang.reflect.Field; import android.app.Activity; import android.os ...

  4. Kyoto Cabinet(DBM) + Kyoto Tycoon(网络层)

    项目原地址kyotocabinet: http://fallabs.com/kyotocabinet/       kyototycoon:   http://fallabs.com/kyototyc ...

  5. 小结JS中的OOP(下)

    关于JS中OOP的具体实现,许多大神级的JS专家都给出了自己的方案. 一:Douglas Crockford 1.1 Douglas Crockford实现的类继承 /** * 原文地址:http:/ ...

  6. 一步步实现Promise

    最近在https://github.com/ThoughtWorksInc/rest-rpc上工作,遇到了一个scala隐式转换的问题,简单的说是要实现这么个东西: implicit def json ...

  7. CentOS安装中文输入法:ibus

    转自 http://gnucto.blog.51cto.com/3391516/935964 系统环境:Centos 6.3 编程语言:python + Bash 输入法:ibus 权限支持:root ...

  8. [POJ] #1008# Maya Calendar : 字符处理/同余问题

    一. 题目 Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 74085   Accepted: 2 ...

  9. dom div重合提示

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  10. 如何调试最新的asp.net mvc源码

    vs2013调试 一.源码当前为5.2.0.0,按下面改为5.0.0.1 二./web.config 版本为5.0.0.0 改为5.0.0.1 三.vs2013 x86 本机工具命令提示 sn.exe ...