Window Height=“Auto” not working as expected

后端 未结 4 904
执笔经年
执笔经年 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 12:45

    Well you can't set the window height to auto, to do this you can use a little trick, name the main main grid container, set its height to auto then bind the window height to the height of the main grid

    0 讨论(0)
  • 2020-12-12 12:55

    Set size in curent screen with loaded event windows

    0 讨论(0)
  • 2020-12-12 13:02

    Set the window's property SizeToContent="WidthAndHeight". This should help.

    0 讨论(0)
  • 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"
    
    0 讨论(0)
提交回复
热议问题