Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor components and OnInitialized() inside another method

$
0
0

I have Blazor component with button. Clicking the button calls the method SetLastDate().

 private string? LastDate { get; set; } protected override void OnInitialized() {     LastDate = lcService.GetLastDate(Uid);   } void SetLastDate() {     lcService.SetDate(Uid)    OnInitialized();  }

Everything is working. But how correct is it to call the OnInitialized() method inside another method If I need to update the UI with new values and styles?

Do this inside the OnParametersSet method, but the point is that no parameters are changed (im just clicking the button with void func) and this method is not invoked.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>