Urgently need control proprtionally resizing itself but not own content RRS feed

  • Question

  • Hello,

    I urgently need control proportionally resizing itself to fill its parent, however without resizing own content.
    That is why ViewBox is NOT a solution.

    Like a Border maintaining original aspect ratio but not resizing containing controls.

    Any help/pointers would be much appreciated.

    Wednesday, June 19, 2013 3:47 PM


All replies

  • Try setting the HorizontalContentAlignment and VerticalContentAlignment to Stretch.
    • Edited by John A R Friday, June 21, 2013 6:17 AM Change wording
    Friday, June 21, 2013 6:16 AM
  • Thanks, but while proportionally resizing it has to maintain initial aspect ratio (desired width/height) as well.

    Friday, June 21, 2013 12:23 PM
  • OK so in the SizeChanged event calculate the control's host actual width and height, and then re size the control accordingly.
    Friday, June 21, 2013 1:13 PM
  • That's what I tried to avoid. Well, probably there is no easier way than. Thanks.
    Saturday, June 22, 2013 12:02 PM