I have the following XAML code in a windows store app:
<Canvas HorizontalAlignment="Left" VerticalAlignment="Top" x:Name="capturePreviewCanvas" Width="774" Margin="288,48,0,0" Height="688">
<CaptureElement x:Name="capturePreviewCaptureElement" Canvas.Left="10" Canvas.Top="10"/>
</Canvas>
I have the CaptureElement
's width and height set to autosize and I expected it to fill the entirety of the parent Canvas
but that doesn't appear to be how it works. If I set the size to Auto
it simply fills the same size area, even if that area is larger than the parent Canvas
(which I didn't think was possible).
Example: Canvas is 500x500, Autosize CaptureElement
sizes itself to around 600x600, exceeding the bounds of its parent Canvas
.
Why does this happen and how do I get the CaptureElement
to always autosize to Fit
or Fill
its parent Canvas
?