question

65010773 avatar image
0 Votes"
65010773 asked ·

Using height property set to auto

Hi

My grid height is set to auto and i would like to set the stackpanel height to 80% grid height
Thanks

windows-uwp-xaml
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

65010773 avatar image
0 Votes"
65010773 answered ·

I found a solution to use the screen size
'stp is the stackpanel



 Dim bounds As New Rect
  Dim scaleFactor As Double
  Dim size1 As Size
  bounds = ApplicationView.GetForCurrentView().VisibleBounds
  scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel
  size1 = New Size(bounds.Width * scaleFactor, bounds.Height * scaleFactor)
  stp.Height = size1.Height * 0.8 / scaleFactor



· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for sharing the solution, you can mark yourself to help others who have the same issue.

0 Votes 0 ·