Closed ChebanovDD closed 1 year ago
To automatically provide a custom BindingContext for child elements.
BindingContext
public class TestItemViewModel : ICollectionItem { [Observable] private readonly IProperty<string> _name = new Property<string>(); ... }
public class TestViewModel : IBindingContext { [Observable] private readonly IProperty<TestItemViewModel> _selectedItem; }
[UxmlElement] public partial class TestItemViewModelProvider : BindingContextProvider<TestItemViewModel> { }
<ui:UXML ...> <BindableUIElements.TestItemViewModelProvider binding-context-path="SelectedItem"> <UnityMvvmToolkit.UITK.BindableUIElements.BindableLabel binding-text-path="Name" /> </BindableUIElements.TestItemViewModelProvider> </ui:UXML>
To automatically provide a custom
BindingContext
for child elements.