It would help if we could see the declaration of the property in the converter, but for now try:
<converters:SomeConverter x:Key="EnumToDataTemplateConverter"
NumericBoxTemplate="{StaticResource xyDataTemplate}"/>
Pergunta
I have a XAML file what is more than 2k lines long. I'd like to refactor to manageable pieces.
In the resources section I have a converter what convert enum to DataTemplate:
<UserControl.Resources>
<converters:SomeConverter x:Key="EnumToDataTemplateConverter">
<converters:SomeConverter.NumericBoxTemplate>
<DataTemplate>
... long template description ...
</DataTemplate>
</converters:SomeConverter.NumericBoxTemplate>
</converters:SomeConverter x:Key="EnumToDataTemplateConverter">
</UserControl.Resources>
I've refactored the DataTemplate to a ResourceDictionary with a x:Key="xyDataTemplate"
My question is how can I create it in the original place?
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="XyTemplate.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<converters:SomeConverter x:Key="EnumToDataTemplateConverter">
<converters:SomeConverter.NumericBoxTemplate>
???
</converters:SomeConverter.NumericBoxTemplate>
</converters:SomeConverter x:Key="EnumToDataTemplateConverter">
</UserControl.Resources>
Solução
It would help if we could see the declaration of the property in the converter, but for now try:
<converters:SomeConverter x:Key="EnumToDataTemplateConverter"
NumericBoxTemplate="{StaticResource xyDataTemplate}"/>