How to bind to a ViewBox in Silverlight?
-
19-09-2019 - |
Question
I have used the ViewBox Silverlight Toolkit control to bind to, however Silverlight 4 add this to the Core, however it no longer has a specific "Content" property to bind to - how to I bind Content to the new ViewBox?
For example I want to be able to do this (not valid syntax):
<ViewBox Content="{Binding Path=Canvas}"/>
Where the Content of the the Viewbox is a Canvas which can itself be many things.
Solution
If I put a ContentPresenter inside the ViewBox and Bind to this it works - putting this as the answer as it may be useful so others as it solved the issue.
<ContentPresenter Content="{Binding Path=Canvas}"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow