When should I use a UserControl instead of a Page?

前端 未结 4 1619
长发绾君心
长发绾君心 2021-01-12 03:27

I notice that many of the WPF MVVM frameworks seem to avoid using the NavigationWindow and Page controls in favor of composing pages using nested UserControls.

The

4条回答
  •  暖寄归人
    2021-01-12 04:20

    I just found some other interesting information related to WPF NavigationWindow and Page on Paul Stovell's website.

    He has this to say about the NavigationWindow class:

    WPF includes a class called NavigationWindow, which is essentially a Window which also doubles as a Frame, by implementing most of the same interfaces. It sounds useful at first, but most of the time you need more control over the Window, so I've never had any need to use this class. I am just pointing it out for the sake of completeness, though your mileage may vary.

    See his in-depth article on WPF Navigation and the Magellan and WPF Page management issues he encountered when writing his Magellan WPF framework.

提交回复
热议问题