Binding a Viewbox to a Canvas
- by Bjarne
I'm trying to bind a Viewbox to Canvas that is created dynamically like so:
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel>
<Viewbox>
<ContentPresenter Content="{Binding Canvas}"/>
</Viewbox>
</DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
This works fine as long as the Canvas doesn't have any children, but as soon at the Canvas has children it's not shown. What am I missing here?