How to 'merge' a XAML file and its code-behind with Visual Studio
I have a template defined in a XAML file named 'MyTemplate.xaml'. This
template is using a code-behind file named 'MyTemplate.cs'.
Mytemplate.xaml:
<ResourceDictionary x:Class="Project.Templates.MyTemplate">
<DataTemplate ... />
</ResourceDictionary>
MyTemplate.cs:
namespace Project.Templates
{
public partial class MyTemplate : ResourceDictionary
{
...
}
}
In the Visual Studio Solution Explorer, these two files are side by side.
What I would like to do is to put these two files together, just like with
a Control and its code-behind. What is the best way to do that? Thank you.
No comments:
Post a Comment