How to stretch in width a WPF user control to its window?

后端 未结 7 1756
执念已碎
执念已碎 2021-01-31 14:52

I have a Window with my user control and I would like to make usercontrol width equals window width. How to do that?

The user control is a horizontal menu and contains a

7条回答
  •  被撕碎了的回忆
    2021-01-31 15:16

    Is the Canvas crucial in your window? If not, try removing it and keep the Grid as the main panel. Canvas has no size unless specified, while a Grid normally takes up all available space. Inside the Canvas, the Grid will have no available space.

提交回复
热议问题