WPF Canvas Binding
- by morsanu
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>