Splitting WPF interface across multiple Xaml files

后端 未结 4 1314
南旧
南旧 2020-12-25 09:51

I am trying to create a user interface using XAML. However, the file is quickly becoming very large and difficult to work with. What is the best way for splitting it across

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-25 10:12

    Use styles and user controls. Divide your interface on smaller parts and code them in another xaml files. Example:




    ...

    ..

    divide it into three xaml files:
    Window.xaml - this will be Window
    VeryBigControl.xaml - this will be UserControl
    VeryBigControlStyle.xaml - this will be resource dictionary
    and so on :)

提交回复
热议问题