There is an application with a placed Canvas in it, you need to set markers on the edges of the Canvas so that when you capture and move the marker, you can resize the Canvas itself. I can't figure out how to draw these markers on the edges of the canvas.
XAML
<Grid Background="DarkGray" DockPanel.Dock="Left"> <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <ItemsControl Name="GeneralItemsControl" HorizontalAlignment="Left" VerticalAlignment="Top" Background="Beige" ItemsSource="{Binding Shapes}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas Name="GeneralCanvas" Width="300" Height="250" Background="White" IsItemsHost="True" MouseLeftButtonDown="OnMouseLeftButtonDown" MouseLeftButtonUp="OnMouseLeftButtonUp" MouseMove="OnMouseMove" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemContainerStyle> <Style> <!-- а это привязка координат контейнера к VM --> <Setter Property="Canvas.Left" Value="{Binding Position.X}" /> <Setter Property="Canvas.Top" Value="{Binding Position.Y}" /> </Style> </ItemsControl.ItemContainerStyle> </ItemsControl> </ScrollViewer> </Grid> 
Canvasplaced in theGridcell, in the narrow neighboring cells above / below / left / right we place oneGridSplitter, and for those that need to work horizontally, setVerticalAlignment="Stretch" HorizontalAlignment="Center", and for vertical ones respectivelyVerticalAlignment="Center" HorizontalAlignment="Stretch". - Alias