Skip to content

How do I separate one screen into separate views #54

Answered by ChebanovDD
MadScientist11 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use the BindingContextProvider.

Progression

public class ProgressionViewModel : IBindingContext
{
    [Observable] private readonly IProperty<int> _task = new Property<int>(69);
}
<ui:UXML xmlns:uitk="UnityMvvmToolkit.UITK.BindableUIElements" ...>
    <uitk:BindingContextProvider name="BindingContextProvider">
        <uitk:BindableLabel binding-text-path="Task" />
    </uitk:BindingContextProvider>
</ui:UXML>

PlayerProgress

public class PlayerProgressViewModel : IBindingContext, IDisposable
{
    [Observable] private readonly IProperty<string> _age;
    [Observable] private readonly IProperty<string> _days;

    private readonly IPlayerLifeCycleService _playerLifeCycleService;

    

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MadScientist11
Comment options

@ChebanovDD
Comment options

Answer selected by MadScientist11
@MadScientist11
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants