title: Multi Data Trigger In Xamarin Forms
body: <p>I am attempting to allow click on my button ONLY if the two text fields are not null.  However, I am getting the compile error of</p>
  
  <blockquote>
    <p>Type multi-data trigger not found</p>
  </blockquote>
  
  <p>Below is my syntax, how should I change it so it executes as desired?</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8" ?&gt;  
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"  
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" &gt;
  &lt;ContentPage.Content&gt;  
      &lt;StackLayout Orientation="Vertical" Padding="30" Spacing="40"&gt;  
          &lt;BoxView HeightRequest="10"/&gt;  
          &lt;Frame BackgroundColor="#BF043055" HasShadow="False"&gt;  
              &lt;StackLayout Orientation="Vertical" Spacing="10"&gt;  
                  &lt;Entry x:Name="Email" Text="{Binding Email}" Placeholder="Email"   
                         PlaceholderColor="Red" HeightRequest="50"   
                         Keyboard="Email" TextColor="Black" /&gt;
                  &lt;Entry x:Name="Password" Text="{Binding Password}" Placeholder="Password"   
                         PlaceholderColor="Red" HeightRequest="50"   
                         IsPassword="True" TextColor="Black" /&gt;  
                  &lt;/StackLayout&gt;  
          &lt;/Frame&gt;  
          &lt;Button x:Name="loginbutton" Command="{Binding SubmitCommand}" Text="Login" TextColor="White"  
                  FontAttributes="Bold" FontSize="Large" HorizontalOptions="FillAndExpand"  
                  BackgroundColor="#088da5" &gt; 
                  &lt;Button.Style&gt;
                    &lt;Style TargetType="{x:Type Button}"&gt;
                        &lt;Style.Triggers&gt;
                            &lt;MultiDataTrigger&gt;
                                &lt;MultiDataTrigger.Conditions&gt;
                                   &lt;Condition Binding="{Binding ElementName=Email, Path=Text.Length, Mode=OneWay}" Value="0"/&gt;
                                   &lt;Condition Binding="{Binding ElementName=Password, Path=Text.Length, Mode=OneWay}" Value="0"/&gt;
                                &lt;/MultiDataTrigger.Conditions&gt;
                                &lt;Setter Property="IsEnabled" Value="False"/&gt;
                           &lt;/MultiDataTrigger&gt;
                       &lt;/Style.Triggers&gt;
                    &lt;/Style&gt;
                  &lt;/Button.Style&gt;
          &lt;/Button&gt;
      &lt;/StackLayout&gt;  
  &lt;/ContentPage.Content&gt;  
  &lt;/ContentPage&gt;  
  </code></pre>
  
  <p><strong>EDIT</strong><br>
  I edited my syntax to the below but I am getting a compile error of:</p>
  
  <blockquote>
    <p>No property, bindable property, or event found for 'ElementName', or mismatching type between value and property.</p>
  </blockquote>
  
  <pre><code>            &lt;Button x:Name="loginbutton" Command="{Binding SubmitCommand}" Text="Login" TextColor="White"  
                  FontAttributes="Bold" FontSize="Large" HorizontalOptions="FillAndExpand"  
                  BackgroundColor="#088da5" &gt; 
                  &lt;Button.Style&gt;
                    &lt;Style TargetType="{x:Type Button}"&gt;
                        &lt;Style.Triggers&gt;
                            &lt;MultiTrigger TargetType="{x:Type Button}"&gt;
                                &lt;MultiDataTrigger.Conditions&gt;
                                   &lt;Condition Binding="{Binding ElementName=Email, Path=Text.Length, Mode=OneWay}" Value="0"/&gt;
                                   &lt;Condition Binding="{Binding ElementName=Password, Path=Text.Length, Mode=OneWay}" Value="0"/&gt;
                                &lt;/MultiDataTrigger.Conditions&gt;
                                &lt;Setter Property="IsEnabled" Value="False"/&gt;
                           &lt;/MultiTrigger&gt;
                       &lt;/Style.Triggers&gt;
                    &lt;/Style&gt;
                  &lt;/Button.Style&gt;
          &lt;/Button&gt;
  </code></pre>