2
votes

Basically i have a component which has a text. This text will change depending on what all other components are doing.

MainPage  
..|---> Text Component  
..|---> Sibling  
...........|--> Child Of sibling 1  
...........|--> Child Of sibling 2  

I mapped a collection of childs to each Sibling.

The text component basically just displays:

var s = listOfChilds.CountSomeSettings() + " is alot";

So the thing is whenenver i change some stuff in my listOfChilds this text component is NOT changing at all. It makes sense, but how can i "notify" my Text Component to rerender itself, because the collection changed?

I tried to have a general _manager which just has the text:

//TextComponent
<p>@_manager.ComputedText</p>

But even if i change the text in my sibling, this text is not changed in my TextComponent

Can you help me here?

1
Could you please provide more code? A stripped down version of your markup would be useful to fully understand. - Björn

1 Answers

3
votes

After you've made a change to the data, you need to call this.StateHasChanged(); to notify the UI of the changes made.