title: The call is ambiguous between the following methods or properties - WPF
body: <p>I have a WPF form that has some buttons to save user input, delete, and cancel. I was trying to add functionality such that whenever the user clicks the cancel button, there is a pop up a message. Instead it throws an exception in my controller: </p>
  
  <pre><code>"The call is ambiguous between the following methods or properties"
  </code></pre>
  
  <p>Here is my view:</p>
  
  <pre><code> &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,0"&gt;                        
      &lt;Button Name="DeleteButton" Command="{Binding DeleteCommand}" CommandParameter="{Binding Path=SelectedStory}"  Cursor="Hand" Height="25" IsEnabled="{Binding CanDelete}" Margin="5 0 0 0"&gt;Delete&lt;/Button&gt;
      &lt;Button Name="SubmitButton" Command="{Binding SubmitCommand}" CommandParameter="{Binding Path=SelectedStory}"  Cursor="Hand" Height="25"  Margin="5 0 0 0"&gt;Submit&lt;/Button&gt;
      &lt;Button Name="CancelButton" Command="{Binding CloseCommand}" CommandParameter="{Binding Path=SelectedStory}"  Cursor="Hand" Height="25" Margin="5 0 0 0" &gt;Cancel&lt;/Button&gt;
   &lt;/StackPanel&gt;
  </code></pre>
  
  <p>My controller code:</p>
  
  <pre><code>    public MetadataController(IGatewayService gateway, IEventAggregator eventAggregator, IDialogService dialog)
      {
          this.gateway = gateway;
          this.eventAggregator = eventAggregator;
          this.dialog = dialog;
  
          // commands            
          this.CloseCommand = new DelegateCommand&lt;StoryItem&gt;(this.Close);//here i got the exception throwing "the call is ambiguous between the following methods or properties"
          this.DeleteCommand = new DelegateCommand&lt;StoryItem&gt;(this.Delete);
          this.SubmitCommand = new DelegateCommand&lt;StoryItem&gt;(this.Submit, this.HasFieldsRequiredBeforeSubmit);
  
          this.eventAggregator.GetEvent&lt;StorySelectedEvent&gt;().Subscribe(OnStorySelected);
      }
  
      private void Close(StoryItem selsectedStory)//when i click my close button its not calling this method at all.
      {
          bool isConfirmed = this.dialog.ShowConfirmation("Are you sure you want to close?");
      }
  
      private void Delete(StoryItem selectedStory)
      {
          bool isConfirmed = this.dialog.ShowConfirmation("Are you sure you want to permanently delete ?");
  
          if (isConfirmed)
          {
              this.gateway.DeleteStoryItem(selectedStory);
  
              this.eventAggregator.GetEvent&lt;CommandCompletedEvent&gt;().Publish(CommandTypes.MetadataEntry);
          }
      }
  </code></pre>