Hi,
we would like to create a CustomControl that derives from a RadComboBox with a special ItemTemplate. On our first approach we tried it with a usual combox by adding to following lines to the Generic.xaml file of the project:
It worked as expected so we changed the baseclass of the custom control to a RadComboBox, searched for the correct "BasedOn" content and changed it to:
Because the RadComboBoxStyle was unknown, we also added the implicit theme XAMLs
to the project's theme folder and added the following includes to the Generic.XAML:
The whole project is just a WPF control assembly that is used by another WPF application project, so it doesn't contain an App.xaml file.
After starting the application it hangs with a XAMLObjectWriterException: Zeilennummer "7" und Zeilenposition "10" von "Beim Festlegen der Eigenschaft "System.Windows.ResourceDictionary.Source" wurde eine Ausnahme ausgelöst.".
Maybe it's just a small missing piece but it also might be a fundamental lack of knowledge since we are new to WPF. Could you please help us out?
Thanks!
David
we would like to create a CustomControl that derives from a RadComboBox with a special ItemTemplate. On our first approach we tried it with a usual combox by adding to following lines to the Generic.xaml file of the project:
<
Style
TargetType
=
"{x:Type local:ComboBoxLookupDataMaterialMainGroups}"
BasedOn
=
"{StaticResource {x:Type ComboBox}}"
>
<
Setter
Property
=
"ItemTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
Individual Template Definition
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
It worked as expected so we changed the baseclass of the custom control to a RadComboBox, searched for the correct "BasedOn" content and changed it to:
<
Style
TargetType
=
"{x:Type local:ComboBoxLookupDataMaterialMainGroups}"
BasedOn
=
"{StaticResource RadComboBoxStyle}"
>
Because the RadComboBoxStyle was unknown, we also added the implicit theme XAMLs
- Telerik.Windows.Controls.XAML and
- Telerik.Windows.Controls.Input.XAML
to the project's theme folder and added the following includes to the Generic.XAML:
<
ResourceDictionary.MergedDictionaries
>
<
ResourceDictionary
Source
=
"Telerik.Windows.Controls.xaml"
/>
<
ResourceDictionary
Source
=
"Telerik.Windows.Controls.Input.xaml"
/>
</
ResourceDictionary.MergedDictionaries
>
The whole project is just a WPF control assembly that is used by another WPF application project, so it doesn't contain an App.xaml file.
After starting the application it hangs with a XAMLObjectWriterException: Zeilennummer "7" und Zeilenposition "10" von "Beim Festlegen der Eigenschaft "System.Windows.ResourceDictionary.Source" wurde eine Ausnahme ausgelöst.".
Maybe it's just a small missing piece but it also might be a fundamental lack of knowledge since we are new to WPF. Could you please help us out?
Thanks!
David