I'm trying the caliburn.micro framework for a new project but I'm stuck with binding a ListPicker (the one from the toolkit). When I change the control to a simple DropDown, everything works as expected. I assume that the DropDown is working correctly, because of the default convention implemented here:
AddElementConvention<Selector>(Selector.ItemsSourceProperty, "SelectedItem", "SelectionChanged")
.ApplyBinding = (viewModelType, path, property, element, convention) => {
if (!SetBinding(viewModelType, path, property, element, convention))
return false;
ConfigureSelectedItem(element, Selector.SelectedItemProperty,viewModelType, path);
ApplyItemTemplate((ItemsControl)element, property);
return true;
};
The ListPicker don't implement Selector, so I've tried to add a custom convention in my bootstrapper:
static void AddCustomConventions() {
AddElementConvention<ListPicker>(ListPicker.ItemsSourceProperty, "SelectedItem", "SelectionChanged")
.ApplyBinding = (viewModelType, path, property, element, convention) => {
ConventionManager.ConfigureSelectedItem(element, ListPicker.SelectedItemProperty,viewModelType, path);
return true;
};
}
Unfortunately, that don't work. Can you help?