4
새 프로젝트에 대해 caliburn.micro 프레임 워크를 사용하고 있지만 ListPicker (툴킷에서 가져온 것)를 바인딩해야합니다. 컨트롤을 간단한 DropDown으로 변경하면 모든 것이 예상대로 작동합니다. 나는 드롭 다운 때문에 기본 협약, 제대로 작동한다고 가정 here 구현 : 선택기를 구현하지 않는WP7의 ListPicker에 대한 caliburn.micro 바인딩 규칙
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;
};
ListPicker을, 그래서 난 내 부트 스트 래퍼에서 사용자 지정 규칙을 추가하는 시도했다 :
static void AddCustomConventions() {
AddElementConvention<ListPicker>(ListPicker.ItemsSourceProperty, "SelectedItem", "SelectionChanged")
.ApplyBinding = (viewModelType, path, property, element, convention) => {
ConventionManager.ConfigureSelectedItem(element, ListPicker.SelectedItemProperty,viewModelType, path);
return true;
};
}
아쉽게도 작동하지 않습니다. 도울 수 있니?