summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml')
-rw-r--r--Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml37
1 files changed, 37 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml b/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml
new file mode 100644
index 00000000..accd9186
--- /dev/null
+++ b/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentPage
+ xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="Xamarin.Forms.Controls.BehaviorsAndTriggers"
+ xmlns:local="clr-namespace:Xamarin.Forms.Controls;assembly=Xamarin.Forms.Controls"
+ Padding="8">
+ <StackLayout>
+ <Label Text="Type red in the entry below" />
+ <Entry x:Name="entry" BackgroundColor="Lime">
+ <Entry.Triggers>
+ <Trigger TargetType="Entry" Property="Text" Value="red">
+ <Setter Property="Entry.BackgroundColor">
+ <Color>#ff0000</Color>
+ </Setter>
+ <Trigger.EnterActions>
+ <local:HThrob />
+ </Trigger.EnterActions>
+ <Trigger.ExitActions>
+ <local:VThrob />
+ </Trigger.ExitActions>
+ </Trigger>
+ <Trigger TargetType="Entry" Property="IsFocused" Value="true">
+ <Setter Property="Entry.BackgroundColor">
+ <Color>#0000ff</Color>
+ </Setter>
+ </Trigger>
+ </Entry.Triggers>
+ </Entry>
+ <Button Text="Click me!">
+ <Button.Behaviors>
+ <local:StopItBehavior />
+ </Button.Behaviors>
+ </Button>
+ <Label BindingContext="{x:Reference entry}" Text="{Binding Path=IsFocused}" />
+ </StackLayout>
+</ContentPage> \ No newline at end of file