Home » FAQ » WPF » Canvas » How do I position the children of a Canvas at a discreet X but stretch them vertically to fill?
You can do so by binding the child’s Height to the Canvas’s ActualHeight, as follows:
[XAML] <Canvas Name='myCanvas'> <Grid Canvas.Left='10' Width='20' Height='{Binding ElementName=myCanvas, Path=ActualHeight}' > </Grid> </Canvas>
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with