WPF Canvas Binding

Posted by morsanu on Stack Overflow See other posts from Stack Overflow or by morsanu
Published on 2010-03-25T11:45:59Z Indexed on 2010/03/25 11:53 UTC
Read the original article Hit count: 693

Filed under:
|
|
|
|

Hey guys,

I'm rather new to WPF, so maybe this is a simple question. I have a class that derives from Canvas, let's call it MyCanvas. And I have a class, MyClass, that has a property of type MyCanvas. In XAML, I built a TabControl, so each TabItem binds to a MyClass object. Now, in the Content of every tab I want to display MyObject.MyCanvas.

How should I do that?

<TabControl.ContentTemplate>
    <DataTemplate>
        <Grid>
            <myCanvas:MyCanvas  Focusable="true" Margin="10" >
                <Binding Path="Canvas"></Binding>
            </screenCanvas:ScreenCanvas>
        </Grid>
    </DataTemplate>
</TabControl.ContentTemplate>

© Stack Overflow or respective owner

Related posts about wpf

Related posts about canvas