Skip to content

Instantly share code, notes, and snippets.

@Char0394
Created June 19, 2018 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Char0394/df790c5607237b227d08517ae179aeb4 to your computer and use it in GitHub Desktop.
Save Char0394/df790c5607237b227d08517ae179aeb4 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:DataTriggersFormsSample"
x:Class="DataTriggersFormsSample.MainPage">
<StackLayout VerticalOptions="StartAndExpand"
Padding="20,60,20,20">
<Entry x:Name="user"
Text=""
Placeholder="user name" />
<Entry x:Name="password"
Text=""
Placeholder="user name"
IsPassword="true" />
<Button Text="Enter"
BackgroundColor="LightSeaGreen"
TextColor="White"
IsEnabled="false">
<Button.Triggers>
<MultiTrigger TargetType="Button">
<MultiTrigger.Conditions>
<BindingCondition Binding="{Binding Source={x:Reference user},
Path=Text}"
Value="Char" />
<BindingCondition Binding="{Binding Source={x:Reference password},
Path=Text}"
Value="1234" />
</MultiTrigger.Conditions>
<Setter Property="IsEnabled" Value="true" />
</MultiTrigger>
</Button.Triggers>
</Button>
</StackLayout>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment