自定义附加属性在XAML中的表示方法以及绑定的注意事项

在XMAL中的表示方法

必须把在XAML中导入CLR名称空间

<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:aqua="clr-namespace:AquariumObjects;assembly=AquariumLibrary"
...
>

使用方法

<Image aqua:Aquarium.IsBubbleSource="true" .../>

参考文档:http://msdn.microsoft.com/zh-cn/library/cc903943%28v=vs.95%29.aspx

绑定到附加属性

想把绑定的path设置成附加属性要加一个括号

实例

<Condition Binding="{Binding Path=(View:MainWindow.IsOverdue)}" Value="true"/>
原文地址:https://www.cnblogs.com/atskyline/p/2683964.html