How do I bind to this custom dependency property?

末鹿安然 提交于 2019-12-06 10:17:27

Try put a name on your CallBoard instance and then refer to that using ElementName in your Binding.

So the root of your page would look like:

    <UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="SilverlightTest.CallBoard"
        x:Name="callBoard"
        ...
    >
    ...

and your Binding would look like:

Width="{Binding ElementName=callBoard, Path=ColumnWidth}"

Does Width="{Binding ColumnWidth}" not work?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!