x:Name
을 기반으로 해당 컨트롤에 바인딩 할 사용자 지정 규칙을 추가해야합니다. 그것은 제 3 자 컨트롤이기 때문에 주위에 방법이 없습니다, 그렇지 않으면 당신은 속성을 사용해야 할 것입니다. 상자 밖의 컨벤션이있는 유일한 컨트롤은 .NET의 wpf/silver/windows 전화 프레임 워크에 포함 된 컨트롤입니다 . 메모리가 나를 섬기면 특정 컨트롤에 필요한 다른 단계가 initialize
이됩니다. 윈도우 폰
ConventionManager.AddElementConvention<RadDataBoundListBox>(DataControlBase.ItemsSourceProperty, "ItemsSource", "SelectionChanged");
ConventionManager.AddElementConvention<RadDockPanel>(RadDockPanel.DockProperty, "Dock", "DockChanged");
ConventionManager.AddElementConvention<RadListPicker>(ItemsControl.ItemsSourceProperty, "ItemsSource", "SelectionChanged");
ConventionManager.AddElementConvention<RadDatePicker>(DateTimePicker.ValueProperty, "Value", "ValueChanged");
ConventionManager.AddElementConvention<RadTimePicker>(DateTimePicker.ValueProperty, "Value", "ValueChanged");
ConventionManager.AddElementConvention<RadToggleSwitch>(RadToggleSwitch.IsCheckedProperty, "IsChecked", "CheckChanged");
ConventionManager.AddElementConvention<RadContextMenuItem>(RadContextMenuItem.CommandProperty, "Command", "Tap");
ConventionManager.AddElementConvention<RadHubTile>(HubTileBase.CommandProperty, "Command", "Tap");
에 대한 Telerik의 UI에 대한 사용자 정의 규칙의
http://caliburnmicro.com/documentation/conventions
예 다음은 아주 기본적인하지만 그에 따라 작업을 얻을. ItemsControl에의 selectedItem가 관련
ConventionManager.AddElementConvention<Pivot>(ItemsControl.ItemsSourceProperty, "SelectedItem", "SelectionChanged").ApplyBinding =
(viewModelType, path, property, element, convention) =>
{
if (ConventionManager
.GetElementConvention(typeof(ItemsControl))
.ApplyBinding(viewModelType, path, property, element, convention))
{
ConventionManager
.ConfigureSelectedItem(element, Pivot.SelectedItemProperty, viewModelType, path);
ConventionManager
.ApplyHeaderTemplate(element, Pivot.HeaderTemplateProperty, null, viewModelType);
return true;
}
return false;
};
고급 대회 ...
당신이 컨트롤 자체와 사용에 노출 가능한 DependencyProperties에 미치는 전적으로 의존 볼 수 있듯이.