SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
BLAZOR COMPONENT
LIFECYCLES
INTR ODUC TION
o Component lifecycles refer to all the stages a
certain software component must go through
during its presence
o Each phase holds a significant value and is
executed at certain points in the lifecycle
o In Blazor, these hooks are divided into three main
methods named as Initialization, Rendering,
Updating and Disposal
COMP ONEN T
LIFE CYCL E
BLAZ OR
https://www.google.com/url?sa=i&url=https%3A%2F%2Fjonathancrozier.com%2Fblog%2Funderstanding-the-blazor-component-
lifecycle&psig=AOvVaw0Mrx23NpWb9KR-
M1BCW_SS&ust=1705920176063000&source=images&cd=vfe&opi=89978449&ved=0CBUQjhxqFwoTCODsxIam7oMDFQAAAAAdAAA
AABAD
LIFE CYCL E CO MPON ENTS
o OnInitialized()
o OnInitializedAsync()
o OnParametersSet()
o BuildRenderTree()
o ShouldRender()
o OnAfterRender()
o OnAfterRenderAsync()
o Dispose()
o StateHasChanged()
O N I N I T I A L I Z E D < A S Y N C > ( )
o Executed when the component is created
o It is only executed once (at the time of initialization)
o Useful in the initialization of any component, where
it must be executed no matter what the case is
o It is invoked before the rendering occurs
o OnInitializedAsync is used if the function triggers an
await in the scope
O N I N I T I A L I Z E D < A S Y N C > ( )
The currentCount is
set to 0 and is placed
as a private variable;
O N I N I T I A L I Z E D < A S Y N C > ( )
Clicking this button
will increment the
value by +1
O N I N I T I A L I Z E D < A S Y N C > ( )
Now, let’s set the
value of
currentCount to 5
and place it inside
OnInitialized()
O N I N I T I A L I Z E D < A S Y N C > ( )
Notice that the OnInitialized method
was called the first thing program got
executed. Now, clicking the button
Click me will increment +1 in the
current count
O N P A R A M E T E R S S E T < A S Y N C > ( )
o Executed immediately after OnInitialized<Async> if this is
the new instance of a component
o If it is an existing instance of a component, then it is called
whenever a change has occurred in the component
o Also called when the component’s parameter is set or
changed
o Parameters are properties annotated with the Parameter
attribute. When these parameters change, then
OnParametersSet is invoked
O N P A R A M E T E R S S E T < A S Y N C > ( )
This is the default Index.razor file
which loads initially when the Blazor
Server project is loaded
We called a Counter.razor (child) in
the Index.razor (parent) along with
the certain parameter childCount
whilst setting its value 5
O N P A R A M E T E R S S E T < A S Y N C > ( )
[Parameter] is used to pass the value
childCount from the child to the parent
Index.razor
Sets the parameter value to the currentCount
which is the part of the child
O N P A R A M E T E R S S E T < A S Y N C > ( )
B U I L D R E N D E R T R E E ( )
o Most crucial when it comes to constructing the virtual DOM
representation of the document.
o Virtual DOM refers to the in-memory representation of the
actual HTML structure
o Defines the structure of component’s render tree
o Adds the element, content and attributes
o Takes one parameter i.e., RenderTreeBuilder
S H O U L D R E N D E R ( )
o Allows you to control whether the component should re-
render or not
o Returns only two values true or false
o Inside ShouldRender(), custom logic is added based on the
current and previous state of the component to decide
whether a re-render is necessary
O N A F T E R R E N D E R < A S Y N C > ( )
o The method gets called after the component has been
rendered in your browser’s DOM
o Used for interacting with HTML element.
o Like getElementById() functionalitiy when we use JavaScript
DOM
o Takes a parameter firstRender indicating whether it is
rendered first time or not
O N A F T E R R E N D E R < A S Y N C > ( )
The program changes the heading Counter
Example’s color to green if value of
currentCount is even and blue is it is odd.
However, the color is black initially
S H O U L D R E N D E R ( )
Only displays the count if it is an even
number
S T A T E H A S C H A N G E D ( )
o Part of the ComponentBase class
o Notifies the Blazor Framework that the state of the
component has changed and that a re-render may be needed
o Used when the changes to the component’s state occur
outside of the normal Blazor event-handling lifecycle
S T A T E H A S C H A N G E D ( )
DISP OSE( )
o It is a part of IDisposable pattern and is used for cleanup
operations when the component is being removed from the
UI
o Allows the developers to release the resources, unsubscribe
from resources, or perform other cleanup tasks
o It’s used typically when a component acquires external
resources such as subscriptions, timers or other objects
needed to be released to prevent memory leaks
DISP OSE( )
THAN K YO U

Contenu connexe

Similaire à #6 | Component Lifecycles | Microsoft Blazor | Sameer Siddiqui

Microcontroller lec 3
Microcontroller  lec 3Microcontroller  lec 3
Microcontroller lec 3Ibrahim Reda
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...Andrey Karpov
 
1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chapthuhiendtk4
 
class based component.pptx
class based component.pptxclass based component.pptx
class based component.pptxsaikatsamanta49
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Sivaranjan Goswami
 
PLSQLmy Updated (1).pptx
PLSQLmy Updated (1).pptxPLSQLmy Updated (1).pptx
PLSQLmy Updated (1).pptxvamsiyadav39
 
The Ring programming language version 1.7 book - Part 85 of 196
The Ring programming language version 1.7 book - Part 85 of 196The Ring programming language version 1.7 book - Part 85 of 196
The Ring programming language version 1.7 book - Part 85 of 196Mahmoud Samir Fayed
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cppNilesh Dalvi
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answersQuratulain Naqvi
 
Structure of c
Structure of cStructure of c
Structure of cdevauro
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxAnkitaVerma776806
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoMark John Lado, MIT
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5REHAN IJAZ
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...RSathyaPriyaCSEKIOT
 

Similaire à #6 | Component Lifecycles | Microsoft Blazor | Sameer Siddiqui (20)

Microcontroller lec 3
Microcontroller  lec 3Microcontroller  lec 3
Microcontroller lec 3
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
 
Angular 2 in-1
Angular 2 in-1 Angular 2 in-1
Angular 2 in-1
 
1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chap
 
class based component.pptx
class based component.pptxclass based component.pptx
class based component.pptx
 
Operators
OperatorsOperators
Operators
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
 
PLSQLmy Updated (1).pptx
PLSQLmy Updated (1).pptxPLSQLmy Updated (1).pptx
PLSQLmy Updated (1).pptx
 
The Ring programming language version 1.7 book - Part 85 of 196
The Ring programming language version 1.7 book - Part 85 of 196The Ring programming language version 1.7 book - Part 85 of 196
The Ring programming language version 1.7 book - Part 85 of 196
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answers
 
SRAVANByCPP
SRAVANByCPPSRAVANByCPP
SRAVANByCPP
 
Structure of c
Structure of cStructure of c
Structure of c
 
basic program
basic programbasic program
basic program
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptx
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John Lado
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
 
Bw14
Bw14Bw14
Bw14
 
C++ Constructs.pptx
C++ Constructs.pptxC++ Constructs.pptx
C++ Constructs.pptx
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
 

Dernier

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Dernier (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

#6 | Component Lifecycles | Microsoft Blazor | Sameer Siddiqui

  • 2. INTR ODUC TION o Component lifecycles refer to all the stages a certain software component must go through during its presence o Each phase holds a significant value and is executed at certain points in the lifecycle o In Blazor, these hooks are divided into three main methods named as Initialization, Rendering, Updating and Disposal
  • 3. COMP ONEN T LIFE CYCL E BLAZ OR https://www.google.com/url?sa=i&url=https%3A%2F%2Fjonathancrozier.com%2Fblog%2Funderstanding-the-blazor-component- lifecycle&psig=AOvVaw0Mrx23NpWb9KR- M1BCW_SS&ust=1705920176063000&source=images&cd=vfe&opi=89978449&ved=0CBUQjhxqFwoTCODsxIam7oMDFQAAAAAdAAA AABAD
  • 4. LIFE CYCL E CO MPON ENTS o OnInitialized() o OnInitializedAsync() o OnParametersSet() o BuildRenderTree() o ShouldRender() o OnAfterRender() o OnAfterRenderAsync() o Dispose() o StateHasChanged()
  • 5. O N I N I T I A L I Z E D < A S Y N C > ( ) o Executed when the component is created o It is only executed once (at the time of initialization) o Useful in the initialization of any component, where it must be executed no matter what the case is o It is invoked before the rendering occurs o OnInitializedAsync is used if the function triggers an await in the scope
  • 6. O N I N I T I A L I Z E D < A S Y N C > ( ) The currentCount is set to 0 and is placed as a private variable;
  • 7. O N I N I T I A L I Z E D < A S Y N C > ( ) Clicking this button will increment the value by +1
  • 8. O N I N I T I A L I Z E D < A S Y N C > ( ) Now, let’s set the value of currentCount to 5 and place it inside OnInitialized()
  • 9. O N I N I T I A L I Z E D < A S Y N C > ( ) Notice that the OnInitialized method was called the first thing program got executed. Now, clicking the button Click me will increment +1 in the current count
  • 10. O N P A R A M E T E R S S E T < A S Y N C > ( ) o Executed immediately after OnInitialized<Async> if this is the new instance of a component o If it is an existing instance of a component, then it is called whenever a change has occurred in the component o Also called when the component’s parameter is set or changed o Parameters are properties annotated with the Parameter attribute. When these parameters change, then OnParametersSet is invoked
  • 11. O N P A R A M E T E R S S E T < A S Y N C > ( ) This is the default Index.razor file which loads initially when the Blazor Server project is loaded We called a Counter.razor (child) in the Index.razor (parent) along with the certain parameter childCount whilst setting its value 5
  • 12. O N P A R A M E T E R S S E T < A S Y N C > ( ) [Parameter] is used to pass the value childCount from the child to the parent Index.razor Sets the parameter value to the currentCount which is the part of the child
  • 13. O N P A R A M E T E R S S E T < A S Y N C > ( )
  • 14. B U I L D R E N D E R T R E E ( ) o Most crucial when it comes to constructing the virtual DOM representation of the document. o Virtual DOM refers to the in-memory representation of the actual HTML structure o Defines the structure of component’s render tree o Adds the element, content and attributes o Takes one parameter i.e., RenderTreeBuilder
  • 15. S H O U L D R E N D E R ( ) o Allows you to control whether the component should re- render or not o Returns only two values true or false o Inside ShouldRender(), custom logic is added based on the current and previous state of the component to decide whether a re-render is necessary
  • 16. O N A F T E R R E N D E R < A S Y N C > ( ) o The method gets called after the component has been rendered in your browser’s DOM o Used for interacting with HTML element. o Like getElementById() functionalitiy when we use JavaScript DOM o Takes a parameter firstRender indicating whether it is rendered first time or not
  • 17. O N A F T E R R E N D E R < A S Y N C > ( ) The program changes the heading Counter Example’s color to green if value of currentCount is even and blue is it is odd. However, the color is black initially
  • 18. S H O U L D R E N D E R ( ) Only displays the count if it is an even number
  • 19. S T A T E H A S C H A N G E D ( ) o Part of the ComponentBase class o Notifies the Blazor Framework that the state of the component has changed and that a re-render may be needed o Used when the changes to the component’s state occur outside of the normal Blazor event-handling lifecycle
  • 20. S T A T E H A S C H A N G E D ( )
  • 21. DISP OSE( ) o It is a part of IDisposable pattern and is used for cleanup operations when the component is being removed from the UI o Allows the developers to release the resources, unsubscribe from resources, or perform other cleanup tasks o It’s used typically when a component acquires external resources such as subscriptions, timers or other objects needed to be released to prevent memory leaks