From the course: Xamarin.Forms Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Trigger a style by property value - Xamarin Tutorial
From the course: Xamarin.Forms Essential Training
Trigger a style by property value
- [Male Voice] There are going to be situations where you don't want the style to apply all the time. Let's get a little more real estate here and so if we look at our style, you may not want to have that background color red all the time, only when there's some sort of an error condition. So lets do style.triggers, and now we can add a trigger in here. We're going to be able to define what's going to trigger the style to get applied. So again we'll use that TargetType, we'll use entry, then we want to use the particular value, so what value is it that's going to trigger this, and we'll say that if you have a zero in the quantity, that's going to be a trigger for us and so we to specify the property as text to indicate that's the property on the entry that we're looking at, and if that value is zero, then we want to go ahead and trigger this. Now inside the trigger, we'll just copy the setter, or rather cut and paste that in. We'll…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Xamarin.Forms layouts4m 20s
-
(Locked)
Create a page using StackLayout5m 18s
-
(Locked)
Use RelativeLayout5m 28s
-
(Locked)
Databinding basics: Display data6m 54s
-
(Locked)
Bind and display a list of data7m 2s
-
(Locked)
Use CollectionView Grid layout2m 47s
-
(Locked)
Create a form page with Grid layout7m 29s
-
(Locked)
Binding to entry fields7m 43s
-
(Locked)
Use ScrollView2m
-
(Locked)
Add style to a control3m 14s
-
(Locked)
Trigger a style by property value2m 14s
-
(Locked)
-
-
-