title: WPF Data binding from ChangedEvent arguments in C#
body: <p>I'm using c# and wpf.</p>
  <p>I have an problem with DataBinding. I have a referance to a bluetooth communication dll and when connection done there is DataChanged event returns like DataChangedEventArgs arg. I'm simple version of handling it with</p>
  <pre><code>private async void BtOnValueChanged(object sender, DataChangedEventArgs arg)
  {
       await this.Dispatcher.InvokeAsync(() =&gt;
             {
                      textblock1.Text=arg.data1;
                      textblock.Text=arg.data2;
                      image1.Visibility=(arg.data3 ? Visibility.Visible : Visibility.Hidden);
                      if(data2&gt;100)
                           textblock1.Foreground=Color.Red;
             });
  }
  </code></pre>
  <p>DataChangedEventArgs has a class like</p>
  <pre><code>public class DataChangedEventArgs
  {
    public string data1 {get;set;}
    public double data2 {get;set;}
    public bool data3 {get;set;}
  }
  </code></pre>
  <p>but I want to do it with Xaml Binding. Only a few things that I need to do with event handler. I tried to get it from direct binding Datachangedevent nothing was show up. Also tried to get all args like</p>
  <pre><code>public static DataChangedEventArgs DataArg; 
  ....
  ....
  private async void BtOnValueChanged(object sender, DataChangedEventArgs arg)
  {
       await this.Dispatcher.InvokeAsync(() =&gt;
             {
                 DataArg=arg;
             });
  }
  </code></pre>
  <p>also tried to bind source in code but I couldn't handle it.</p>
  <p>Can anyone help me.</p>