title: Background thread lambda callback
body: <p>At the moment when my background thread is complete it runs a System.Action callback using an anonymous lambda statement. I'm wondering how can I rewrite the code below to have a callback/lambda statement using a Completed function.</p>
  
  <p>ViewModel : BaseViewModel</p>
  
  <pre><code>public override void Initialize(System.Action onInitializeCallback = null)
  {.....
      BackgroundEntityWorker.RunWorkerCompleted += (sender, args) =&gt;
      {
          If (onInitializeCallback != null)
          {
              onInitializeCallback();
          }    
      };
  .....
  }
  </code></pre>
  
  <p>I want to change it to something below</p>
  
  <pre><code>BackgroundEntityWorker.RunWorkerCompleted += BackgroundWorker_Completed =&gt;
  {
      If (onInitializeCallback != null)
      {
          onInitializeCallback();
      }    
  };
  </code></pre>
  
  <p>BaseViewModel</p>
  
  <pre><code>public virtual void Reload(int? id = null, Action&lt;T&gt; callback = null)
  {    
      Initialize(() =&gt;
      {
          Localize();
  
          if (id == null)
          {
              IndicateLoading(false);
          }
          else
          {
              Load(id.Value, () =&gt; IndicateLoading(false));
          }
      });
  }
  </code></pre>
  
  <p>I get an error <code>Argument type 'Lambda expression</code> is not assignable to parameter type <code>System.ComponentModel.RunWorkerCompletedEventHandler</code></p>
  
  <p>I tried </p>
  
  <pre><code>BackgroundEntityWorker.RunWorkerCompleted += BackgroundWorker_Completed;
  </code></pre>
  
  <p>but I lose my callback, how do I set it to have BackGroundWorker_Completed and maintain my callback?</p>