Customize Xamarin.Forms controls and pages with renderers, behaviors, and effects.
- [Scott J. Peterson] There's no doubt the Xamarin platform is absolutely phenomenal. In fact, there never has been anything like it available to developers for creating apps that compile natively, perform well and share such a huge amount of code for almost every situation. But the reality is there are always things you may want to do that enhance or extend the features and functionality of a platform for user business-specific scenarios or maybe requirements to man alternative behaviors or rendering for specific controls. The ability to override and extend controls who control behaviors is another area where the Xamarin Forms platform really shines.
I'm Scott J. Peterson and this is Mastering Xamarin Forms Development, Renderers, Behaviors, and Effects. In most robust mobile app development, scenarios exist where controls or elements of the user experience need to be rendered in very specific ways and events need to be created, enhanced or extended in order to achieve specific user, developer or business-rule functionality. In the Xamarin Forms platform, logic can easily be attached or assigned to user interface elements on a platform-by-platform basis, to instruct a control to render with platform-specific instructions, like a custom Renderer or a lightweight version of a Renderer, an Effect.
Xamarin Forms platform also contains the concept of behaviors and extends that with a concept of Xamarin Forms Behaviors to easily achieve these types of development goals. Like all of the sessions in this series, we're going to be spending most of our time in Visual Studio 2017, in code, actually creating the things that we're talking about. So, let's take a look at what we're going to cover in this section. First, we're going to review some basic concepts around Renderers, Behaviors, and Effects.
Now, this is not only in the area that there's a little bit of confusion, but the truth is, there's not always an exact, right way to implement Renderers, Behaviors, or Effects. There are just, sometimes, personal preferences. Renderers, Behaviors, and Effects are grouped into the same series because in general, not always, but in general, it provides the same functionality, just in different ways. Here, we're going to talk about Renderers and common Renderers scenarios, just to better understand when a developer might use a renderer, and then we'll look at how we implement renderers and actually go into Visual Studio 2017 and work with some custom renderers in our Xamarin Forms cross-platform app, Paperboy, we've been working on in this series.
And then we're going to do the same thing with behaviors and talk about some of the differences between Attached and Xamarin Forms behaviors, talk about some common behaviors scenarios, and then go into Visual Studio and actually implement some behaviors in our news-reader Paperboy app. And then we're going to finish up with the same thing for effects. Now, effects is a little bit of a strange term. We're not really talking about visual effects necessarily, although we could achieve dramatic visual effects with an effect. We're going to talk about Xamarin Form effects and how it can leverage effects to provide additional functionality in our cross-platform app.
And then, we're going to flip back into Visual Studio 2017 and actually implement some effects so that we have a good contrast between what a renderer would do, what a behavior would do, and what an effect would do and how those things provide additional functionality and in what ways they provide additional functionality for a Xamarin Forms App. And then, as always, we'll finish up with some great next steps.
- Implementing renderers
- Working with custom renderers
- Implementing behaviors
- Working with effects