SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
XAMARIN FORMS
NOOB TO MASTER
By Rendy Del Rosario and Charlin Agramonte
Week 4
Objectives
- Understand what is a Control/Bindable properties and how to use it
- Understand what is a Custom Renderer
- Understand what is an Effect
Custom Renderers
What is a Custom Renderer?
Custom renderers provide a powerful approach for customizing the appearance
and behavior of Xamarin.Forms controls
Native Controls
Every Xamarin.Forms control has an accompanying renderer for each platform
that creates an instance of a native control.
Native Controls
Creating a Custom Renderer Step by Steps
1-Create a Xamarin.Forms custom control
2-Consume the custom control from Xamarin.Forms
3-Create the custom renderer for the control on each platform.
1-Create a Custom control
Can be created by subclassing the Control
2-Consume the custom control
- Add the nameSpace of your Control in your XAML, with a
variable (in this case Local)
- Use your variable with your Control Name
3-Create the custom renderer for the control on each
platform.
1- Subclass the platform renderer for the element on each platform
3-Create the custom renderer for the control on each
platform.
2- Override the OnElementChanged method that renders the native
control and write logic to customize the control. This method is called
when the corresponding Xamarin.Forms control is created.
3-Create the custom renderer for the control on each
platform.
3-Add an ExportRenderer attribute to the custom renderer class to
specify that it will be used to render the Xamarin.Forms control.
GROUP PRACTICE
Creating our first Custom Renderer
Renderer Good Pattern
Custom Properties
A bindable property is a special type of property, where the property's value is tracked by the
Xamarin.Forms property system.
INDIVIDUAL EXERCISE
Create a Custom Renderer for Underline a Label
TIME: 30 MINUTES
Effects
What is an Effect?
Effects allow the native controls on each platform to be customized, and are
typically used for small styling changes.
Why Use an Effect over a Custom Renderer?
Effects simplify the customization of a control, are reusable, and can be
parameterized to further increase reuse.
Creating an Effect Step by Steps
1-Create a subclass of the PlatformEffect class
2-Override the OnAttached method and write logic to customize the control
3-Override the OnDetached method and write logic to clean up the control
customization, if required.
4-Setting an effect identifier
5-Consum your effect
1-Create a subclass of the PlatformEffect class
2-Override the OnAttached method and write logic to
customize the control
OnAttached is called when the effect is added to a control
3-Override the OnDetached method and write logic
to clean up the control customization, if required.
OnDetached indicates the effect is being removed from the control, should reverse
any visual changes, remove event handlers, etc
Monitoring runtime changes
Effects can also monitor changes to the Xamarin.Forms Element by overriding the
OnElementPropertyChanged method
4-Add a ResolutionGroupName attribute to the effect
class.
5-Consume your effect
1- Declare a control that will be customized by the effect
2-Attach the effect to the control by adding it to the control's Effects
collection.
XAML
CODE BEHIND
GROUP PRACTICE
Creating our first Effect
Effect Parameters
A public class that subclasses the RoutingEffect class should be created to represent
effect parameters, as demonstrated in the following code example:
Creating
Consuming
INDIVIDUAL EXERCISE
Create an Effect for Underline a Label
TIME: 30 MINUTES
HOMEWORK PRACTICE
Basic Paint
Recommended Lectures
- Custom Renderers
- https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-rendere
r/
https://www.youtube.com/watch?v=55r1wHdOLBo
- Effects
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/effects/creating/
https://www.youtube.com/watch?v=cFcwQhc1utg
By Rendy Del Rosario and Charlin Agramonte
Week 4
THANK YOU!!!

Contenu connexe

Similaire à Xamarin Workshop Noob to Master – Week 4

Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your OwnLambert Beekhuis
 
Mastercam basics-tutorial
Mastercam basics-tutorialMastercam basics-tutorial
Mastercam basics-tutorialssuserf5e931
 
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...marjoramg
 
Patch Management Software - Administrator Guide
Patch Management Software - Administrator Guide Patch Management Software - Administrator Guide
Patch Management Software - Administrator Guide websecurity
 
VMware App Volumes Troubleshooting
VMware App Volumes TroubleshootingVMware App Volumes Troubleshooting
VMware App Volumes TroubleshootingDenis Gundarev
 
Session on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log managementSession on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log managementpqrs1234
 
Automation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadAutomation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadDurga Prasad
 
Automation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabadAutomation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabadDurga Prasad
 
MY EASY CENTER FOR SYSTEM CENTER CONFIGURATION MANAGER
MY EASY CENTER FOR SYSTEM CENTER CONFIGURATION MANAGERMY EASY CENTER FOR SYSTEM CENTER CONFIGURATION MANAGER
MY EASY CENTER FOR SYSTEM CENTER CONFIGURATION MANAGEREasy Center Corp Consulting
 
Architecture: Manual vs. Automation
Architecture: Manual vs. AutomationArchitecture: Manual vs. Automation
Architecture: Manual vs. AutomationAmazon Web Services
 
Controllers and context programming
Controllers and context programmingControllers and context programming
Controllers and context programmingKranthi Kumar
 
What the hell is PowerShell?
What the hell is PowerShell?What the hell is PowerShell?
What the hell is PowerShell?NETUserGroupBern
 
Level Up With Parallelism in FME Server
Level Up With Parallelism in FME ServerLevel Up With Parallelism in FME Server
Level Up With Parallelism in FME ServerSafe Software
 
scope of the kaseya smart pilot
scope of the kaseya smart pilotscope of the kaseya smart pilot
scope of the kaseya smart pilotkaseyaindia
 
8.scope of the kaseya smart pilot
8.scope of the kaseya smart pilot8.scope of the kaseya smart pilot
8.scope of the kaseya smart pilotkaseyaindia
 
Intro to Automation Using Perfecto's CQ Lab
Intro to Automation Using Perfecto's CQ LabIntro to Automation Using Perfecto's CQ Lab
Intro to Automation Using Perfecto's CQ LabLizzy Guido (she/her)
 

Similaire à Xamarin Workshop Noob to Master – Week 4 (20)

Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
 
Mastercam basics-tutorial
Mastercam basics-tutorialMastercam basics-tutorial
Mastercam basics-tutorial
 
Unveiling FME 2019
Unveiling FME 2019Unveiling FME 2019
Unveiling FME 2019
 
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
 
Patch Management Software - Administrator Guide
Patch Management Software - Administrator Guide Patch Management Software - Administrator Guide
Patch Management Software - Administrator Guide
 
Magento Meetup New Delhi- Console
Magento Meetup New Delhi- ConsoleMagento Meetup New Delhi- Console
Magento Meetup New Delhi- Console
 
VMware App Volumes Troubleshooting
VMware App Volumes TroubleshootingVMware App Volumes Troubleshooting
VMware App Volumes Troubleshooting
 
Session on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log managementSession on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log management
 
Automation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadAutomation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in Hyderabad
 
Automation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabadAutomation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabad
 
MY EASY CENTER FOR SYSTEM CENTER CONFIGURATION MANAGER
MY EASY CENTER FOR SYSTEM CENTER CONFIGURATION MANAGERMY EASY CENTER FOR SYSTEM CENTER CONFIGURATION MANAGER
MY EASY CENTER FOR SYSTEM CENTER CONFIGURATION MANAGER
 
Architecture: Manual vs. Automation
Architecture: Manual vs. AutomationArchitecture: Manual vs. Automation
Architecture: Manual vs. Automation
 
Controllers and context programming
Controllers and context programmingControllers and context programming
Controllers and context programming
 
What the hell is PowerShell?
What the hell is PowerShell?What the hell is PowerShell?
What the hell is PowerShell?
 
Level Up With Parallelism in FME Server
Level Up With Parallelism in FME ServerLevel Up With Parallelism in FME Server
Level Up With Parallelism in FME Server
 
scope of the kaseya smart pilot
scope of the kaseya smart pilotscope of the kaseya smart pilot
scope of the kaseya smart pilot
 
8.scope of the kaseya smart pilot
8.scope of the kaseya smart pilot8.scope of the kaseya smart pilot
8.scope of the kaseya smart pilot
 
Intro to Automation Using Perfecto's CQ Lab
Intro to Automation Using Perfecto's CQ LabIntro to Automation Using Perfecto's CQ Lab
Intro to Automation Using Perfecto's CQ Lab
 
SCCM 2019 Demo.pptx
SCCM 2019 Demo.pptxSCCM 2019 Demo.pptx
SCCM 2019 Demo.pptx
 
Diving Into Xamarin.Forms
Diving Into Xamarin.Forms Diving Into Xamarin.Forms
Diving Into Xamarin.Forms
 

Plus de Charlin Agramonte

Trabajando con máquinas de estados en.NET
Trabajando con máquinas de estados en.NETTrabajando con máquinas de estados en.NET
Trabajando con máquinas de estados en.NETCharlin Agramonte
 
Improving the ux of our xamarin forms apps
Improving the ux of our xamarin forms appsImproving the ux of our xamarin forms apps
Improving the ux of our xamarin forms appsCharlin Agramonte
 
Integrando un rest api con refit
Integrando un rest api con refitIntegrando un rest api con refit
Integrando un rest api con refitCharlin Agramonte
 
Mejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Mejorando el UX de nuestras aplicaciones móviles en Xamarin FormsMejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Mejorando el UX de nuestras aplicaciones móviles en Xamarin FormsCharlin Agramonte
 
Desenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLIDDesenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLIDCharlin Agramonte
 
Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms Charlin Agramonte
 
Como prepararse y conseguir trabajo como Mobile Developer
Como prepararse y conseguir trabajo como Mobile DeveloperComo prepararse y conseguir trabajo como Mobile Developer
Como prepararse y conseguir trabajo como Mobile DeveloperCharlin Agramonte
 
Desarrollando apps multi plataformas con xamarin forms
Desarrollando apps multi plataformas con xamarin formsDesarrollando apps multi plataformas con xamarin forms
Desarrollando apps multi plataformas con xamarin formsCharlin Agramonte
 
C#good practices in 10 minutes
C#good practices in 10 minutesC#good practices in 10 minutes
C#good practices in 10 minutesCharlin Agramonte
 
Xamarin Forms Best Practices
Xamarin Forms Best PracticesXamarin Forms Best Practices
Xamarin Forms Best PracticesCharlin Agramonte
 
Why xamarin forms is awesome
Why xamarin forms is awesomeWhy xamarin forms is awesome
Why xamarin forms is awesomeCharlin Agramonte
 
Prism in xamarin forms from zero to hero
Prism in xamarin forms from zero to hero Prism in xamarin forms from zero to hero
Prism in xamarin forms from zero to hero Charlin Agramonte
 
Xamarin forms from zero to hero
Xamarin forms from zero to heroXamarin forms from zero to hero
Xamarin forms from zero to heroCharlin Agramonte
 

Plus de Charlin Agramonte (20)

State machine in .NET
State machine in .NETState machine in .NET
State machine in .NET
 
Trabajando con máquinas de estados en.NET
Trabajando con máquinas de estados en.NETTrabajando con máquinas de estados en.NET
Trabajando con máquinas de estados en.NET
 
Improving the ux of our xamarin forms apps
Improving the ux of our xamarin forms appsImproving the ux of our xamarin forms apps
Improving the ux of our xamarin forms apps
 
Integrando un rest api con refit
Integrando un rest api con refitIntegrando un rest api con refit
Integrando un rest api con refit
 
Mejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Mejorando el UX de nuestras aplicaciones móviles en Xamarin FormsMejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Mejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
 
Desenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLIDDesenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLID
 
Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms
 
C# Good practices
C# Good practicesC# Good practices
C# Good practices
 
Starting my blog
Starting my blogStarting my blog
Starting my blog
 
C# Best Practices
C# Best PracticesC# Best Practices
C# Best Practices
 
Como prepararse y conseguir trabajo como Mobile Developer
Como prepararse y conseguir trabajo como Mobile DeveloperComo prepararse y conseguir trabajo como Mobile Developer
Como prepararse y conseguir trabajo como Mobile Developer
 
Desarrollando apps multi plataformas con xamarin forms
Desarrollando apps multi plataformas con xamarin formsDesarrollando apps multi plataformas con xamarin forms
Desarrollando apps multi plataformas con xamarin forms
 
C#good practices in 10 minutes
C#good practices in 10 minutesC#good practices in 10 minutes
C#good practices in 10 minutes
 
Xamarin Forms Best Practices
Xamarin Forms Best PracticesXamarin Forms Best Practices
Xamarin Forms Best Practices
 
Xamarin Forms Evolution
Xamarin Forms EvolutionXamarin Forms Evolution
Xamarin Forms Evolution
 
Why xamarin forms is awesome
Why xamarin forms is awesomeWhy xamarin forms is awesome
Why xamarin forms is awesome
 
Visual studio 2019 launch
Visual studio 2019 launch Visual studio 2019 launch
Visual studio 2019 launch
 
Prism in xamarin forms from zero to hero
Prism in xamarin forms from zero to hero Prism in xamarin forms from zero to hero
Prism in xamarin forms from zero to hero
 
Xamarin forms - overcloud
Xamarin forms - overcloudXamarin forms - overcloud
Xamarin forms - overcloud
 
Xamarin forms from zero to hero
Xamarin forms from zero to heroXamarin forms from zero to hero
Xamarin forms from zero to hero
 

Dernier

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Dernier (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Xamarin Workshop Noob to Master – Week 4

  • 1. XAMARIN FORMS NOOB TO MASTER By Rendy Del Rosario and Charlin Agramonte Week 4
  • 2. Objectives - Understand what is a Control/Bindable properties and how to use it - Understand what is a Custom Renderer - Understand what is an Effect
  • 4. What is a Custom Renderer? Custom renderers provide a powerful approach for customizing the appearance and behavior of Xamarin.Forms controls
  • 5. Native Controls Every Xamarin.Forms control has an accompanying renderer for each platform that creates an instance of a native control.
  • 7. Creating a Custom Renderer Step by Steps 1-Create a Xamarin.Forms custom control 2-Consume the custom control from Xamarin.Forms 3-Create the custom renderer for the control on each platform.
  • 8. 1-Create a Custom control Can be created by subclassing the Control
  • 9. 2-Consume the custom control - Add the nameSpace of your Control in your XAML, with a variable (in this case Local) - Use your variable with your Control Name
  • 10. 3-Create the custom renderer for the control on each platform. 1- Subclass the platform renderer for the element on each platform
  • 11. 3-Create the custom renderer for the control on each platform. 2- Override the OnElementChanged method that renders the native control and write logic to customize the control. This method is called when the corresponding Xamarin.Forms control is created.
  • 12. 3-Create the custom renderer for the control on each platform. 3-Add an ExportRenderer attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms control.
  • 13. GROUP PRACTICE Creating our first Custom Renderer
  • 15. Custom Properties A bindable property is a special type of property, where the property's value is tracked by the Xamarin.Forms property system.
  • 16. INDIVIDUAL EXERCISE Create a Custom Renderer for Underline a Label TIME: 30 MINUTES
  • 18. What is an Effect? Effects allow the native controls on each platform to be customized, and are typically used for small styling changes.
  • 19. Why Use an Effect over a Custom Renderer? Effects simplify the customization of a control, are reusable, and can be parameterized to further increase reuse.
  • 20. Creating an Effect Step by Steps 1-Create a subclass of the PlatformEffect class 2-Override the OnAttached method and write logic to customize the control 3-Override the OnDetached method and write logic to clean up the control customization, if required. 4-Setting an effect identifier 5-Consum your effect
  • 21. 1-Create a subclass of the PlatformEffect class
  • 22. 2-Override the OnAttached method and write logic to customize the control OnAttached is called when the effect is added to a control
  • 23. 3-Override the OnDetached method and write logic to clean up the control customization, if required. OnDetached indicates the effect is being removed from the control, should reverse any visual changes, remove event handlers, etc
  • 24. Monitoring runtime changes Effects can also monitor changes to the Xamarin.Forms Element by overriding the OnElementPropertyChanged method
  • 25. 4-Add a ResolutionGroupName attribute to the effect class.
  • 26. 5-Consume your effect 1- Declare a control that will be customized by the effect 2-Attach the effect to the control by adding it to the control's Effects collection. XAML CODE BEHIND
  • 28. Effect Parameters A public class that subclasses the RoutingEffect class should be created to represent effect parameters, as demonstrated in the following code example: Creating Consuming
  • 29. INDIVIDUAL EXERCISE Create an Effect for Underline a Label TIME: 30 MINUTES
  • 31. Recommended Lectures - Custom Renderers - https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-rendere r/ https://www.youtube.com/watch?v=55r1wHdOLBo - Effects https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/effects/creating/ https://www.youtube.com/watch?v=cFcwQhc1utg
  • 32. By Rendy Del Rosario and Charlin Agramonte Week 4 THANK YOU!!!