title: WinUI 3 Binding to a static property
body: <p>In WPF you could use the following code to bind a control to a static property:</p>
  <p>Xaml:</p>
  <pre><code>&lt;TextBox Text=&quot;{Binding Path=(local:ViewModel.Txt), Mode=TwoWay, 
          UpdateSourceTrigger=PropertyChanged}&quot;&gt;
  &lt;/TextBox&gt;
  </code></pre>
  <p>Static view model:</p>
  <pre><code>public static class ViewModel
  {
      private static string txt;
      public static event EventHandler TxtChanged;
  
      public static string Txt
      {
          get
          {
              return txt;
          }
  
          set
          {
              if (txt != value)
              {
                  txt = value;
                  TxtChanged?.Invoke(null, EventArgs.Empty);
              }
          }
      }
  </code></pre>
  <p>However, this doesn't seem to work in a winUI 3 project. VS 2022 doesn't give any errors in the user code, but shows an 'object reference not set to an instance of an object' error in Microsoft.UI.Xaml.Markup.Compiler.interop.targets.</p>
  <p>Is binding to static properties supported in winUI 3, either using Binding or x:Bind? Thanks for any info.</p>