AutoDataTemplateBindingHookUnsafe class¶
Attributes: [RequiresDynamicCode("AutoDataTemplateBindingHookUnsafe hosts each item in a ViewModelViewHostUnsafe, which asks the service locator for IViewFor<> closed over the view model's run-time type. Use AutoDataTemplateBindingHook, which uses the generated view lookup and Map registrations, to stay ahead-of-time safe.")] [DebuggerDisplay("AutoDataTemplateBindingHookUnsafe")]
Defined in
Namespace: ReactiveUI
Assembly: ReactiveUI.WinUI.dll
Full name: ReactiveUI.AutoDataTemplateBindingHookUnsafe
Modifiers: public
Summary¶
A binding hook that gives an ItemsControl a default item template hosting each item in a ViewModelViewHostUnsafe.
Applies to
net10.0-windows10.0.19041, net481
Class hierarchy
classDiagram
class AutoDataTemplateBindingHookUnsafe
class IPropertyBindingHook {
<>
}
IPropertyBindingHook <|.. AutoDataTemplateBindingHookUnsafe
Implements: IPropertyBindingHook
Remarks¶
AutoDataTemplateBindingHook is registered by WithWinUI and hosts each item in a
ViewModelViewHost, which asks the generated view lookup and the view locator's Map
registrations. Register this hook as well when a list shows view models whose view is registered only with the
service locator. It replaces the default template AutoDataTemplateBindingHook assigned, and leaves every
template the app set itself alone.
ViewModelViewHostUnsafe closes a generic type over the view model's run-time type, so this hook is not safe to compile ahead of time.
Examples¶
<![CDATA[
RxAppBuilder.CreateReactiveUIBuilder()
.WithWinUI()
.WithRegistration(static r => r.RegisterConstant<IPropertyBindingHook>(new AutoDataTemplateBindingHookUnsafe()))
.BuildApp();
]]>
Constructors¶
| Name | Summary |
|---|---|
| .ctor |
Properties¶
| Name | Summary |
|---|---|
| static DefaultItemTemplate | Gets the default item template, which hosts each item in a [ViewModelViewHostUnsafe](# |
Methods¶
| Name | Summary |
|---|---|
| ExecuteHook | Called as a binding is set up, before it is wired, and can refuse the binding. |