{"id":278463,"date":"2021-01-13T22:46:43","date_gmt":"2021-01-13T14:46:43","guid":{"rendered":"http:\/\/4563.org\/?p=278463"},"modified":"2021-01-13T22:46:43","modified_gmt":"2021-01-13T14:46:43","slug":"%e8%af%b7%e6%95%99%e5%a4%a7%e4%bd%ac%e4%bb%ac-wpf-binding-%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=278463","title":{"rendered":"\u8bf7\u6559\u5927\u4f6c\u4eec WPF Binding \u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u6559\u5927\u4f6c\u4eec WPF Binding \u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : iSNN <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h4>\u6700\u8fd1\u5728\u5199 WPF\uff0c\u6709\u8bb8\u591a\u663e\u793a\u72b6\u6001\u989c\u8272\u7684\u6309\u94ae\uff0c60 \u4e2a\u5de6\u53f3\uff0c\u6309\u94ae\u989c\u8272\u7528 Binding \u7ed1\u4e86\u540e\u53f0\u7684\u5c5e\u6027\uff0c\u8fd9\u4e2a\u5c5e\u6027\u662f\u6ca1\u6709\u7528\u5b57\u6bb5\u7684\uff0c\u662f\u5728 get \u91cc\u5224\u65ad status \u72b6\u6001\u5b57\u6bb5 0\uff0c1\uff0c2&#8230;\u7136\u540e\u8fd4\u56de Brushes \u3002<\/h4>\n<h4>\u6240\u4ee5\u903b\u8f91\u5c31\u662f\u9009\u62e9\u4e86\u4e00\u4e2a\u9009\u9879\uff0c\u7136\u540e\u5224\u65ad\u6bcf\u4e2a\u6309\u94ae\u72b6\u6001\u4fee\u6539 status\uff0cOnPropertyChanged \u901a\u77e5\u53d8\u66f4 Brush \u5c5e\u6027\u3002<\/h4>\n<h4>\u6211\u5728 brush \u7684 get \u91cc\u9762\u65ad\u70b9\u6216\u8005 writeline \u90fd\u8bc1\u660e\u786e\u5b9e\u53d8\u66f4\u65f6\u4ece\u65b0\u8c03\u7528\u4e86 get\uff0c\u4f46\u662f\u753b\u9762\u6ca1\u6709\u53d8\uff0c\u7136\u540e\u518d\u8c03\u6574\u753b\u9762\u5927\u5c0f\uff0c\u5de6\u53f3\u4e0a\u4e0b\u53ea\u8981\u4e00\u62c9\u4f38\u6216\u8005\u7f29\u5c0f\u5c31\u50cf\u5237\u65b0\u4e00\u6837\uff0c\u5c31\u53c8\u663e\u793a\u51fa\u6765\u4e86\uff0c\u6b64\u65f6 get \u65b9\u6cd5\u6ca1\u6709\u518d\u6b21\u8c03\u7528\u3002<\/h4>\n<h4>\u63a8\u6d4b\uff0c\u5176\u5b9e\u753b\u9762\u5df2\u7ecf get \u5230\u4e86\u65b0\u7684\u989c\u8272\uff0c\u53ea\u662f\u6ca1\u6709\u6e32\u67d3\u4e0a\u53bb\uff0c\u8c03\u6574\u5927\u5c0f\u65f6\u5c31\u4ece\u65b0\u6e32\u67d3\u4e86\u753b\u9762\u3002<\/h4>\n<h4>\u8bf7\u95ee\u5404\u4f4d\u5927\u4f6c\uff0c\u6709\u6ca1\u6709\u597d\u7684\u89e3\u51b3\u65b9\u6848\u5462&#8230;<\/h4>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>6<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4926853\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8fd9\u79cd\u4e0d\u4f26\u4e0d\u7c7b\u7684\u7ed1\u5b9a\u662f\u600e\u4e48\u56de\u4e8b\u3002\u3002wpf \u600e\u4e48\u53ef\u80fd\u77e5\u9053\u4f60 brush \u548c\u6309\u94ae\u7684\u5173\u7cfb\u5462                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4926854\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Moyudawang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5\u5148\u8bd5\u8bd5\u7ed9\u6309\u94ae\u7ed1\u5b9a\u5b57\u7b26\u4e32\u6709\u6ca1\u6709\u6548\u679c\uff0c\u7136\u540e\u518d\u5224\u65ad\u662f\u54ea\u91cc\u51fa\u4e86\u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4926855\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : iSNN <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @codehz \u7ed1\u90fd\u7ed1\u4e0a\u4e86\uff0c\u600e\u4e48\u4f1a\u4e0d\u77e5\u9053\u4ec0\u4e48\u5173\u7cfb&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4926856\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : iSNN <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Moyudawang \u6bcf\u4e2a\u6309\u94ae\u4e0a\u6709\u4e2a\u8868\u793a\u4e2a\u6570\u7684\u5c0f\u6c14\u6ce1\uff0c\u7528\u7684 MaterialDesign \u7684 Badged \u3002\u6570\u5b57\u786e\u5b9e\u6ca1\u4e86\uff0c\u5176\u5b9e\u753b\u9762\u4e0a\u6709\u5173\u8fd9\u4e2a\u9009\u62e9\u540e\u9700\u8981 OnPropertyChanged \u7684\u5b57\u6bb5\u90fd\u6302\u4e86\uff0c\u4f46\u662f\u6211\u628a brush \u7684\u7ed1\u5b9a\u6ce8\u5c04\u540e\uff0c\u5176\u4ed6\u7ed1\u5b9a\u5b57\u6bb5\u53c8\u662f\u6b63\u5e38\u7684\uff0c\u80fd\u5b9e\u65f6\u6e32\u67d3\u3002\u521a\u521a\u6700\u65b0\u7684\u7ed3\u679c\u662f\uff0cbadge \u548c brush \u5355\u72ec\u7ed1\u5b9a\u662f\u6b63\u5e38\u7684\uff0c\u5982\u679c\u7ed1\u4e86 badge \u53c8\u7ed1\u4e86 brush \u5c31\u4e0d\u884c\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4926857\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : forgottencoast <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u53d1\u4e00\u4e2a\u793a\u4f8b\u9879\u76ee\u51fa\u6765\u770b\u770b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4926858\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : slowhand <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u627e\u4e86\u4e00\u4e0b\u81ea\u5df1\u4ee5\u524d\u7528\u8fc7\u7684\u65b9\u6cd5\uff0c\u7c7b\u4f3c\u8fd9\u6837\u3002<\/p>\n<p> public static readonly DependencyProperty TitleBackgroundProperty =<br \/> DependencyProperty.Register(&#8220;TitleBackground&#8221;, typeof(Brush), typeof(ButtonIcon), new PropertyMetadata(Brushes.Black));<br \/> \/\/\/ &lt;summary&gt;<br \/> \/\/\/ \u6807\u9898\u80cc\u666f<br \/> \/\/\/ &lt;\/summary&gt;<br \/> public Brush TitleBackground<br \/> {<br \/> get { return (Brush)GetValue(TitleBackgroundProperty); }<br \/> set { SetValue(TitleBackgroundProperty, value); }<br \/> }<\/p>\n<p>&lt;Border Grid.Row=&#8221;1&#8243; Background=&#8221;{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path= TitleBackground}&#8221;\/&gt;                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u6559\u5927\u4f6c\u4eec WPF Binding&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/278463"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278463"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/278463\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278463"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}