Class AutoDataTemplateBindingHook
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.Wpf.dll
AutoDataTemplateBindingHook is a binding hook that checks ItemsControls that don't have DataTemplates, and assigns a default DataTemplate that loads the View associated with each ViewModel.
public class AutoDataTemplateBindingHook : IPropertyBindingHook
- Inheritance
-
AutoDataTemplateBindingHook
- Implements
- Extension Methods
Constructors
AutoDataTemplateBindingHook()
public AutoDataTemplateBindingHook()
Properties
DefaultItemTemplate
Gets the default item template.
public static Lazy<DataTemplate> DefaultItemTemplate { get; }
Property Value
Methods
ExecuteHook(object?, object, Func<IObservedChange<object, object>[]>, Func<IObservedChange<object, object>[]>, BindingDirection)
Called when any binding is set up.
public bool ExecuteHook(object? source, object target, Func<IObservedChange<object, object>[]> getCurrentViewModelProperties, Func<IObservedChange<object, object>[]> getCurrentViewProperties, BindingDirection direction)
Parameters
source
objectThe source ViewModel.
target
objectThe target View (not the actual control).
getCurrentViewModelProperties
Func<IObservedChange<object, object>[]>Get current view model properties.
getCurrentViewProperties
Func<IObservedChange<object, object>[]>Get current view properties.
direction
BindingDirectionThe Binding direction.
Returns
- bool
If false, the binding is cancelled.