If you want your Canvas defined in XAML to include the entire Canvas in your class as a separate element that you can write:
<Canvas>
<ContentPresenter Content="{Binding ClassCanvas}" />
... other items here ...
</Canvas>
If you want your Canvas defined in XAML to include all the same UIElements as Canvas defined in your class, this is not possible because a UIElement can have only one UIElement parent. So, if a Canvas defined in a class is the parent of a given UIElement, a Canvas defined in XAML cannot be.
, Canvas UIElement Canvas, , ItemsControl Canvas DataTemplate:
<ItemsControl ItemsSource="{Binding ClassCanvas.Children}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl>
<ItemsControl.ItemsContainerStyle>
<Style>
<Setter Property="Canvas.Left" Value="{Binding (Canvas.Left)}" />
<Setter Property="Canvas.Left" Value="{Binding (Canvas.Top)}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
... display of UIElement here, either using VisualBrush or custom display
</ControlTemplate>
<Setter.Value>
</Setter>
</Style>
</ItemsControl.ItemsContainerStyle>
</ItemsControl>
, Children , INotifyCollectionChanged.
, UIElements Canvas.Top Canvas.Left, , ObservableCollection Canvas.
Canvas . ObservableCollection Canvas .