<p>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 several files.</p>

<p>I would like to be able to set the content of an element such as a ComboBox to an element that is defined in a different xaml file (but in the same VS project).</p>

<p>thanks</p>

You can split up XAML files by using a
ResourceDictionary
. The ResourceDictionary can be used to merge other files:
```
```
<Page.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="myresourcedictionary.xaml"/>
      <ResourceDictionary Source="myresourcedictionary2.xaml"/>
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Page.Resources>
```
```
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.