title: Can I handle thrown exceptions in XAML?
body: <p>In my XAML I get all customers by binding to a GetAll property:</p>
  
  <pre><code>&lt;ListBox ItemsSource="{Binding GetAll}" 
       ItemTemplate="{StaticResource allCustomersDataTemplate}"
       Style="{StaticResource allCustomersListBox}"&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>The GetAll property is an observable collection in my view model, which calls the Model to get all collection of customers:</p>
  
  <pre><code>public class CustomersViewModel
  {
      public ObservableCollection&lt;Customer&gt; GetAll {
          get
          {
              try
              {
                  return Customer.GetAll;
              }
              catch (Exception ex)
              {
                  throw new Exception(ex.Message);
              }
          }
      }
  }
  </code></pre>
  
  <p>If anything goes wrong in the model (badly formed XML file, etc.) then an exception bubbles up all the way to that GetAll property in the ViewModel. </p>
  
  <p><strong>First Question:</strong> I was surprised that <strong><em>XAML doesn't seem to do anything with the exception</em></strong> and just goes ahead and displays nothing. Is this by design? Is this part of the "decoupling approach"?</p>
  
  <p><strong>Second Question:</strong> This leads me to think <strong><em>I could handle the exception in XAML somehow</em></strong>, such as</p>
  
  <p><em>Pseudo Code:</em></p>
  
  <pre><code>&lt;Trigger&gt;
      &lt;Trigger.OnException&gt;
          &lt;TextBox Text="The customer data could not be loaded."/&gt;
      &lt;/Trigger.OnException&gt;
  &lt;/Trigger&gt;
  </code></pre>
  
  <p>Is something like the above code possible?</p>