Binding a Viewbox to a Canvas

Posted by Bjarne on Stack Overflow See other posts from Stack Overflow or by Bjarne
Published on 2010-05-23T15:29:49Z Indexed on 2010/05/23 18:00 UTC
Read the original article Hit count: 457

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about wpf-binding