Splitting WPF interface across multiple Xaml files

后端 未结 4 1296
南旧
南旧 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:34

    You can split up XAML files by using a ResourceDictionary. The ResourceDictionary can be used to merge other files:

    
      
        
          
          
        
      
    
    

    In the ResourceDictionary, you can also declare Styles that you can use at your elements, such that the main XAML file gets smaller.

    Another possibility to get a smaller XAML file is to define your own controls that you then use in your main app.

提交回复
热议问题