Windows form/WPF too large, how can i split it up?

后端 未结 6 2059
青春惊慌失措
青春惊慌失措 2021-01-01 03:32

I\'m about to create WPF application. So far at uni the only way we have ever done GUIs is to have one main window with one code-behind file for handling its button clicks e

6条回答
  •  鱼传尺愫
    2021-01-01 03:37

    You should create each screen as UserControl and reference that in your MainWindow xaml.

    However, it seems like you have an enormous design flaw in your application, i.e. having your logic in the UI. The code-behind file is not there to drive your application or logic, it is there to drive your UI! You might want to have a look into the MVC pattern and Dependency Injection to solve this.

    The Wpf Application Framework would be a start for that.

提交回复
热议问题