摘要: 在项目中实际设计中需要改变RichTextBox的UI呈现,今天在Coding的过程中发现在RichTextBox的ControlTemplate中使用ContentPresenter并不能将RichTextBox的Content呈现出来。 查看MSDN,参见http://msdn.microsoft.com/en-us/library/ff457769(v=vs.95).aspx 原来要将Content的呈现只需将PART_ContentHost写入Template即可。 代码如下: <Grid> <RichTextBox> <RichTextBox.Docum 阅读全文
posted @ 2012-08-06 20:35 老鱼_678 阅读(1942) 评论(0) 推荐(0) 编辑
摘要: 接上篇, 我们来看一看Elementname,Source,RelativeSource 三种绑定的方式 1.ElementName顾名思义就是根据Ui元素的Name来进行绑定: 例子: <Window x:Name="MainWindow"> <Grid> <Button Background=”{Binding ElementName=MainWindow, Path=Background}”/> </Grid> </Window> 效果等同于 <Window> <Grid> <B 阅读全文
posted @ 2012-08-06 10:58 老鱼_678 阅读(9858) 评论(1) 推荐(1) 编辑