Using height property set to auto

Shay Wilner 1,726 Reputation points
2020-04-29T07:15:31.07+00:00

Hi

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

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Shay Wilner 1,726 Reputation points
    2020-04-29T09:13:04.363+00:00

    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
    

0 additional answers

Sort by: Most helpful