zip's

while(true) { Write it down; Think about it; Refine it; Sleep(); }

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

随笔分类 -  Data Binding

摘要:很好的学习资料 http://karlshifflett.wordpress.com/2011/06/29/boise-prism-unity-wpf-mvvm-code-and-decks/ https://skydrive.live.com/?cid=51de981e071f222b&sc=documents&uc=1&id=51DE981E071F222B%21321# 阅读全文
posted @ 2011-07-19 09:12 zip's 阅读(829) 评论(0) 推荐(0)

摘要:适度的结合 xmal 和 code behind在学习和实践了一段日子 data binding 后,一直追求完全使用 xaml 而不用 code behind 去实现 data/command binding。感觉这个想法不是很正确,如果希望设计出完美支持 xaml 的 view model 和 data model 还是不容易,尤其是经验有限的时候。问题:举一个例子,设想你有一个 editable 的 combobox ,有2个按钮,一个“rename”,一个 “add name” (这里不讨论为什么这么设计,就要这么实现)。希望使用 command binding 来实现 rename。 阅读全文
posted @ 2010-12-15 17:32 zip's 阅读(223) 评论(0) 推荐(0)

摘要:推荐阅读:http://www.codeproject.com/KB/WPF/wpfvalidation.aspxTextBox定制 Validation.ErrorTemplateTIP:这里在 ControlTemplate 里为 AdornedElementPlaceHolder 命名,方便在后面的 Binding 中引用;使用另外一个 TextBlock 显示 阅读全文
posted @ 2010-10-20 15:15 zip's 阅读(1352) 评论(0) 推荐(0)

摘要:绑定到另一个控件的属性<StackPanel> <TextBox x:Name="theTextBox"/> <TextBlock Text="{Binding Text, ElementName=theTextBox}"/></StackPanel>上面这个例子,TextBlock的内容绑定了TextBox,当在TextBox里输入文本是,TextBlock也同时显示---绑定到 RelativeSource<ListBox ItemsSource="{Binding MyDataSrc} 阅读全文
posted @ 2010-08-18 14:58 zip's 阅读(507) 评论(0) 推荐(0)