Window Height=“Auto” not working as expected

后端 未结 4 910
执笔经年
执笔经年 2020-12-12 12:16

What I am trying to do is show a window, that does not explicitly have a height/width, (both values omitted or set to Auto). I was guessing that the window wou

4条回答
  •  眼角桃花
    2020-12-12 13:04

    Old question but an updated answer:

    As @Muad'Dib suggested in his answer :

    you should set SizeToContent="WidthAndHeight".

    If the size of content of window increases more than the screen size, window can overflow from screen. So, you must consider:

    MaxWidth="600"
    MaxHeight="400"
    

提交回复
热议问题