I am new to WPF, so maybe this is a simple question. I have a class that comes from Canvas, let it be called MyCanvas. And I have a class MyClass that has a property of type MyCanvas. In XAML, I created a TabControl, so each TabItem is bound to a MyClass object. Now in the Content of each tab, I want to display MyObject.MyCanvas.
How should I do it?
<TabControl.ContentTemplate>
<DataTemplate>
<Grid>
<myCanvas:MyCanvas Focusable="true" Margin="10" >
<Binding Path="Canvas"></Binding>
</myCanvas:MyCanvas>
</Grid>
</DataTemplate>
</TabControl.ContentTemplate>
source
share