Skip to content

Add BindingContextProvider #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ChebanovDD opened this issue May 29, 2023 · 0 comments
Closed

Add BindingContextProvider #17

ChebanovDD opened this issue May 29, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ChebanovDD
Copy link
Collaborator

To automatically provide a custom BindingContext for child elements.

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>
@ChebanovDD ChebanovDD converted this from a draft issue May 29, 2023
@ChebanovDD ChebanovDD self-assigned this May 29, 2023
@ChebanovDD ChebanovDD added the enhancement New feature or request label May 29, 2023
@ChebanovDD ChebanovDD changed the title Add BindableContextProvider Add BindingContextProvider May 29, 2023
@ChebanovDD ChebanovDD moved this from 🏗 In progress to 👀 In review in UnityMvvmToolkit May 29, 2023
@ChebanovDD ChebanovDD moved this from 👀 In review to ✅ Done in UnityMvvmToolkit May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant