Skip to content

How to wait for parameter's setter to execute? #380

Answered by egil
anddrzejb asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @anddrzejb,

Interesting problem. I would suspect that

        bool handlerCalled = false;
        Action OnDataSourceChangedHandler = () => handlerCalled = true;

        var cut = Render<AntComponent<int, Person>>(
            @<AntComponent DataSource="@_persons"            
                Value="0"
                OnDataSourceChanged="OnDataSourceChangedHandler">
            </AntComponent>);

would call the setter of DataSource during SetParametersAsync like normal. If it didn't, then there is something fundamentally wrong with bUnit.

My best guess is that DataSource is set before OnDataSourceChanged, thus meaning property in the component OnDataSourceChanged is null when DataSource

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@egil
Comment options

@anddrzejb
Comment options

@egil
Comment options

@anddrzejb
Comment options

@egil
Comment options

Answer selected by anddrzejb
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