Blazor Tutorial C# - Part 9 - Blazor Timer & Blazor Dispose Timer | Blazor Timer not Stopping

preview_player
Показать описание
Blazor Tutorial C# - Part 9 is a tutorial video which explains everything about Blazor Timer & Blazor Timer Disposal.

Learn Blazor with Coding Droplets. Below is the Blazor Tutorial Playlist Link:

Timers are always useful, but at the same time always tricky. That tricky part usually comes with a problem when a background process needs to access (update) some user interface details.

Topics covered in this video:
1. Blazor Timer & Usage of Timer Blazor
How to implement timer in Blazor [Timer in Blazor C#] properly and update the User Interface on each interval. Clearly explains how to use timer in Blazor. In this video we implement a Blazor timer example [Blazor Timer Sample] which displays Date & Time in the User Interface real time.

2. Blazor Timer Disposal [Blazor Dispose Timer]
Timer disposal in Blazor is a very important topic because the timer won't get disposed if the user navigate to a different page. You can see that Blazor timer dont stop [Blazor timer not stopping] and Blazor timer run continuously even after the user navigates to a different page.

This is not a Blazor Timer issue / Blazor Timer problem. But we need to dispose the timer in Blazor by implementing IDisposable interface. This video explains how to stop Blazor timer by disposing it after its usage.

Video Chapters:
0:00 - Intro
1:51 - How to use Timer in Blazor
11:15 - Dispose Timer Blazor
Рекомендации по теме
Комментарии
Автор

Thank you for watching this video.
View the complete tutorial playlist:

CodingDroplets
Автор

There is a problem if you click the "refresh" button in the browser. It will create a new instance of Timer.
Dispose() function be triggerd but timer.Dispose() seams doesn't work.
Could you please have a try?

adamzhang
Автор

What I missed here is highlighting that becaus OnInitialize is called for each page navigation, without disposal, there will be multiple instances of that timer. As the console had shown clearly.

zoltanzorgo
Автор

how i reload my index page after x seconds? thanks

vianaalimentar
visit shbcf.ru