title: Overloaded method for DelegateCommand
body: <p>I have a DelegateCommand class and within it 2 constructors. When I pass my property to the constructor of that class I get an error message that says:</p>
  
  <pre><code>Error   1   The best overloaded method match for 'QMAC.ViewModels.DelegateCommand.DelegateCommand(System.Action&lt;object&gt;)' has some invalid arguments
  
  Error   2   Argument 1: cannot convert from 'System.Windows.Input.ICommand' to 'System.Action&lt;object&gt;'
  </code></pre>
  
  <p>For my DelegateCommand, here is what I have (without comments to keep it short):</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  using System.Windows.Input;
  
  namespace QMAC.ViewModels
  {
      class DelegateCommand : ICommand
      {
          private Action&lt;object&gt; _execute;
          private Predicate&lt;object&gt; _canExecute;
  
          public DelegateCommand(Action&lt;object&gt; execute) : this(execute, null)
          {
  
          }
  
          public DelegateCommand(Action&lt;object&gt; execute, Predicate&lt;object&gt; canExecute)
          {
              _execute = execute;
              _canExecute = canExecute;
          }
  
          public bool CanExecute(object parameter)
          {
              if (_canExecute.Equals(null))
              {
                  return true;
              }
  
              return _canExecute(parameter);
          }
  
          public void Execute(object parameter)
          {
              _execute(parameter);
          }
  
          public void RaiseCanExecuteChanged()
          {
              if (CanExecuteChanged != null)
              {
                  CanExecuteChanged(this, EventArgs.Empty);
              }
          }
      }
  }
  </code></pre>
  
  <p>Here is the property and the function that I am  trying to pass:</p>
  
  <pre><code>using QMAC.Models;
  using System;
  using System.Collections.Generic;
  using System.Net.NetworkInformation;
  using System.Text;
  using System.Windows.Input;
  using System.Windows.Threading;
  
  namespace QMAC.ViewModels
  {
      class MainViewModel: ViewModelBase
      {
          Address address;
          Location location;
          private string _locationPicked;
          private string _ipAddress;
          private DelegateCommand _exportCommand;
  
          public MainViewModel()
          {
              address = new Address();
              location = new Location();
              _ipAddress = address.IPAddress;
              _exportCommand = new DelegateCommand(ExportCommand);
          }
  
  public ICommand ExportCommand
          {
              get { return _exportCommand; }
          }
  
          public void ExportList()
          {
  
          }
      }
  }
  </code></pre>
  
  <p>Because the 1st error has to deal with an overloaded method I know I'm just overlooking something really simple. As for the second error, what would be a better way to handle that since I can't pass that Property.</p>