My code will draw a graphic and, before the paint event, I need to set the size of element containing the graphic. In part, this comes from a value in an XAML file:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="35" />
</Grid.RowDefinitions>
...
</Grid>
During the view initialization, I'm hoping to be able to modify the graphic width based on some other factors, but I need the height value, from XAML.
At a breakpoint, I can view the various View values, and at this point ActualHeight
and ActualWidth
are still 0. I don't see anything else I could use.
Is there another event, coming before paint, that I could use ?
question from:
https://stackoverflow.com/questions/65851739/uwp-how-to-get-element-size-before-painting 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…