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

后端 未结 7 1754
执念已碎
执念已碎 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:14

    What container are you adding the UserControl to? Generally when you add controls to a Grid, they will stretch to fill the available space (unless their row/column is constrained to a certain width).

提交回复
热议问题