Without specifying a specific size, I found that binding the MaxWidth
and MaxHeight
to the ActualWidth
and ActualHeight
of the parent element keeps the InkCanvas
from expanding outside the element.
<Grid x:Name="LayoutRoot">
<InkCanvas x:Name="DrawingArea"
MaxWidth="{Binding ActualWidth, ElementName=LayoutRoot}"
MaxHeight="{Binding ActualHeight, ElementName=LayoutRoot}"
Background="{x:Null}" />
...
</Grid>