|
Hello everybody,
I'm encountering a problem when using an Implicit Data Template in Caliburn.Micro (version : 1.3.1) (Silverlight 5)
I have 3 model classes:
- Facture: the root class
- FactureAcompte: inherits from Facture
- FactureSejour: inherits from Facture
The view model contains a BindableCollection<Facture> (BindableCollection<Facture> FacturesImpayees).
My view contains a ListBox which binds to the bindable collection declared previously with caliburn-based convention
<ListBox x:Name="FacturesImpayees"
Grid.Row="1">
The bindable collection contains FactureAcompte typed items and FactureSejour typed items. for that, I chose to use implicit data templates of SL5
Declaration of the data template:
<DataTemplate x:Key="FactureSejourDataTemplate"
DataType="Entities:FactureSejour">
<DataTemplate x:Key="FactureAcompteDataTemplate"
DataType="Entities:FactureAcompte">
<DataTemplate x:Key="FactureDataTemplate"
DataType="Entities:Facture">
Entities is the alias of the namespace in which are located the
I always encounter the problem: cannot find view for ...FactureAcompte.
By trying to find the root cause of the problem in Caliburn.Micro, I found that Caliburn does not
consider the item templates that I declared , and it puts a default template.
If there any problem about what I made ? Could someone provide me with a correct implementation
(a sample) of how to implement Implicit Data Templates in Silverlight with Caliburn.Micro conventions.
Regards
|