I want to create a custom control which should display a stylish ComboBox inside it. So 1. LeafControl and 2. LeafComboBox.
I have Kept both the ControlTemplate styles in the same Generic.xaml file, which is not correct i guess. Because during initialization of LeafControl depends upon the template creation of LeafComboBox.
So during loading i am getting exception :
Error Msg:
"The invocation of the constructor on type 'ControlsLibrary.LeafComboBox' that matches the specified binding constraints threw an exception."}"
Inner Error Msg :
"{"PropertyMetadata is already registered for type 'LeafControl'."}
Hence, where should i define the Generics.xml Templates so that i can use customcontrol2 in customcontrol1.
Best Regards, Manoranjan