Binding dependency property to another user control isn't binding
Posted: 17 Aug 2022, 17:12
Hello,
Hitting a bit of a strange issue with dependency properties and user controls.
I have a user control where a string is passed in as a dependency property:
Inside that user control it calls another user control passing that same dependency property value down:
This doesn't work and just appears to do nothing. But if I bind that same property to the TextBlock control it displays that value:
If I assign the value directly to the nested user control it also works:
Any ideas/tips would be much appreciated!
Hitting a bit of a strange issue with dependency properties and user controls.
I have a user control where a string is passed in as a dependency property:
Code: Select all
<components:FullscreenModalComponent ImagesDir="/Images/collections_jpg" />
Code: Select all
<components:ResponsiveImageComponent ImagesDir="{Binding ElementName=Root, Path=ImagesDir}" />
Code: Select all
<TextBlock Text="{Binding ElementName=Root, Path=ImagesDir}" />
Code: Select all
<components:ResponsiveImageComponent ImagesDir="/Images/collections_jpg" />