wpf - How to 'merge' a XAML file and its code-behind with Visual Studio -
i have template defined in xaml file named 'mytemplate.xaml'. template using 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 visual studio solution explorer, these 2 files side side. put these 2 files together, control , code-behind.
what have:
what have:
what best way that? thank you.
you need edit .csproj file. find <compile>
element mytemplate.cs, , add <dependentupon>
element under it:
<compile include="mytemplate.cs"> <dependentupon>mytemplate.xaml</dependentupon> </compile>
see blog post: make project item child item of another
Comments
Post a Comment