Triggers in Xamarin.Forms 1.3

Yesterday, I wrote about one of the new features in Xamarin.Forms 1.3 (Technology Preview 2), Styles.  Today I’ll take a first look at Triggers.

Triggers

The key idea of Triggers is “When this happens, do that.” More specifically, “When this property has that value, then set this other property to this new value.”  Huh?  Perhaps this is easier to show than to explain.

Let’s suppose we’re building a form and we’d like to enhance the Entry control so that when the user is entering data the text color is blue, but when they are done the text color turns black.

Step one is to create a style in the Resource Dictionary and to give that Style a set of Triggers… Continued here

About Jesse Liberty

Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen online courses. His latest book, Building APIs with .NET will be released early in 2025. Liberty is a Senior SW Engineer for CNH and he was a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Microsoft MVP.
This entry was posted in Xamarin and tagged , , . Bookmark the permalink.