title: MAUI - Multibinding from XAML Does Not Work with Fields in Code-Behind
body: <p>I'm trying to write a PDF-editing piece where the user must pick both a PDF and an image to add to it before continuing. While multibinding seems like the tool for the job, updating the filepickers behind <code>LoadImageButton</code> and <code>LoadPdfButton</code> apparently does nothing and <code>FilesValidConverter</code> is never entered. What am I missing here and, more importantly, why?</p>
  <p>XAML Page:</p>
  <pre class="lang-xaml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;ContentPage xmlns=&quot;http://schemas.microsoft.com/dotnet/2021/maui&quot;
               xmlns:x=&quot;http://schemas.microsoft.com/winfx/2009/xaml&quot;
               xmlns:local=&quot;using:MauiTestApp&quot;
               x:Class=&quot;MauiTestApp.MainPage&quot;&gt;
  
      &lt;ContentPage.Resources&gt;
          &lt;local:FilesValidConverter x:Key=&quot;FilesValidConverter&quot; /&gt;
      &lt;/ContentPage.Resources&gt;
      
      &lt;ScrollView&gt;
          &lt;VerticalStackLayout
              Spacing=&quot;25&quot;
              Padding=&quot;30,0&quot;
              VerticalOptions=&quot;Center&quot;&gt;
  
              &lt;HorizontalStackLayout Spacing=&quot;1&quot;&gt;
                  &lt;Button 
                      x:Name=&quot;LoadImageButton&quot; 
                      Clicked=&quot;OnLoadImageClicked&quot;
                      Text=&quot;Select an Image&quot;
                  /&gt;
              &lt;/HorizontalStackLayout&gt;
  
              &lt;HorizontalStackLayout&gt;
                  &lt;Button
                      x:Name=&quot;LoadPdfButton&quot; 
                      Clicked=&quot;OnLoadPdfClicked&quot;
                      Text=&quot;Select a PDF&quot;
                  /&gt;
              &lt;/HorizontalStackLayout&gt;
  
  
              &lt;Button
                  x:Name=&quot;ImportImageButton&quot;
                  Text=&quot;Save&quot;
                  SemanticProperties.Hint=&quot;Save entered data&quot;
                  Clicked=&quot;OnSaveClicked&quot;
                  HorizontalOptions=&quot;Center&quot; &gt;
              &lt;Button.IsEnabled&gt;
                      &lt;MultiBinding Converter=&quot;{StaticResource FilesValidConverter}&quot;&gt;
                          &lt;Binding Path=&quot;LoadedImage&quot; /&gt;
                          &lt;Binding Path=&quot;LoadedPdf&quot; /&gt;
                      &lt;/MultiBinding&gt;
                  &lt;/Button.IsEnabled&gt;
              &lt;/Button&gt;
  
          &lt;/VerticalStackLayout&gt;
      &lt;/ScrollView&gt;
  
  &lt;/ContentPage&gt;
  </code></pre>
  <p>Code-Behind:</p>
  <pre><code>    using System.Globalization;
      using System.Reactive.Linq;
      
      namespace MauiTestApp;
      
      public partial class MainPage : ContentPage
      {
          public FileResult LoadedImage;
          public FileResult LoadedPdf;
      
          public MainPage()
          {
              InitializeComponent();
          }
      
          private async void OnLoadImageClicked(object sender, EventArgs args)
          {
              LoadedImage = await FilePicker.PickAsync(new PickOptions
              {
                  FileTypes = FilePickerFileType.Images,
                  PickerTitle = &quot;Add an image&quot;
              });
          }
      
          private async void OnLoadPdfClicked(object sender, EventArgs args)
          {
              LoadedPdf = await FilePicker.PickAsync(new PickOptions
              {
                  FileTypes = FilePickerFileType.Pdf,
                  PickerTitle = &quot;Add a PDF&quot;
              });
          }
      
          private void OnSaveClicked(object sender, EventArgs args)
          {
              // Reset the test setup
              LoadedImage = null;
              LoadedPdf = null;
              ImportImageButton.IsEnabled = false;
          }
      }
      
      public class FilesValidConverter : IMultiValueConverter
      {
          public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
          {
              return values.All(x =&gt; x is not null);
          }
      
          public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
          {
              throw new NotImplementedException();
          }
      }
  </code></pre>