I have two ways of running function in my Blazor app.
"e => action(message)">@message
- >Click
The first code line should work on change meanwhile the second works on click. I cannot find out why the first one is not working. My program logic is as follows:
- @code {
- GameManager _gameM;
- public string message { get; set; } = "test";
- protected override void OnInitialized()
- {
- _gameM = new GameManager();
- _gameM.MainLoopCompleted += (e, o) => StateHasChanged();
- _gameM.MainLoopCompleted += (e, o) => special();
- }
- public async Task action(string message)
- {
- var confirmed = await js.InvokeAsync<bool>("confirm", $"{message}");
- if(confirmed)
- {
- Console.WriteLine("working");
- }
- }
- public void special()
- {
- message = _gameM.message;
- }
- }
In this code I have a line:
- _gameM.MainLoopCompleted += (e, o) => special();
Which for sure changes @message inside
Mario ScheerenPosted Nov 3, 2020, 5:13 AM
to
are tags for headlines ... they do not realle have any input events.they can trigger.