# GrapeCity.Viewer.Common.DelegateCommand-1

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_Viewer_Common_DelegateCommand_1" data-uid="GrapeCity.Viewer.Common.DelegateCommand`1" class="text-break">DelegateCommand&lt;TParm&gt; Class
</h1>
  <div class="markdown level0 summary"><p>Represents a command that delegates its implementation to a delegate with a parameter of type TParm.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">DelegateCommand&lt;TParm&gt;</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="GrapeCity.Viewer.Common.ICommand.html">ICommand</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.Viewer.Common.html">GrapeCity.Viewer.Common</a></h6>
  <h6><strong>Assembly</strong>: MESCIUS.ActiveReports.Viewer.Common.dll</h6>
  <h5 id="GrapeCity_Viewer_Common_DelegateCommand_1_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class DelegateCommand&lt;TParm&gt; : ICommand</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">TParm</span></td>
        <td><p>The type of parameter used by the command.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Viewer_Common_DelegateCommand_1__ctor_System_Action__0__" data-uid="GrapeCity.Viewer.Common.DelegateCommand`1.#ctor(System.Action{`0})">
          <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.-ctor.html#GrapeCity_Viewer_Common_DelegateCommand_1__ctor_System_Action__0__">DelegateCommand(Action&lt;TParm&gt;)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.html">DelegateCommand&lt;TParm&gt;</a> class.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Viewer_Common_DelegateCommand_1__ctor_System_Action__0__System_Predicate__0__" data-uid="GrapeCity.Viewer.Common.DelegateCommand`1.#ctor(System.Action{`0},System.Predicate{`0})">
          <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.-ctor.html#GrapeCity_Viewer_Common_DelegateCommand_1__ctor_System_Action__0__System_Predicate__0__">DelegateCommand(Action&lt;TParm&gt;, Predicate&lt;TParm&gt;)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.html">DelegateCommand&lt;TParm&gt;</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Viewer_Common_DelegateCommand_1_CanExecute_System_Object_" data-uid="GrapeCity.Viewer.Common.DelegateCommand`1.CanExecute(System.Object)">
          <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.CanExecute.html#GrapeCity_Viewer_Common_DelegateCommand_1_CanExecute_System_Object_">CanExecute(object)</a>
        </td>
        <td class="markdown level1 summary"><p>Defines the method that determines whether the command can execute in its current state.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Viewer_Common_DelegateCommand_1_Execute_System_Object_" data-uid="GrapeCity.Viewer.Common.DelegateCommand`1.Execute(System.Object)">
          <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.Execute.html#GrapeCity_Viewer_Common_DelegateCommand_1_Execute_System_Object_">Execute(object)</a>
        </td>
        <td class="markdown level1 summary"><p>Defines the method to be called when the command is invoked.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Viewer_Common_DelegateCommand_1_OnCanExecuteChanged_System_EventArgs_" data-uid="GrapeCity.Viewer.Common.DelegateCommand`1.OnCanExecuteChanged(System.EventArgs)">
          <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.OnCanExecuteChanged.html#GrapeCity_Viewer_Common_DelegateCommand_1_OnCanExecuteChanged_System_EventArgs_">OnCanExecuteChanged(EventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the CanExecuteChanged event, notifying subscribers that the ability to execute the command has changed.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Viewer_Common_DelegateCommand_1_RaiseCanExecuteChanged" data-uid="GrapeCity.Viewer.Common.DelegateCommand`1.RaiseCanExecuteChanged">
          <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.RaiseCanExecuteChanged.html#GrapeCity_Viewer_Common_DelegateCommand_1_RaiseCanExecuteChanged">RaiseCanExecuteChanged()</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the CanExecuteChanged event from external code.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Viewer_Common_DelegateCommand_1_CanExecuteChanged" data-uid="GrapeCity.Viewer.Common.DelegateCommand`1.CanExecuteChanged">
          <a class="xref" href="GrapeCity.Viewer.Common.DelegateCommand-1.CanExecuteChanged.html">CanExecuteChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when the ability of the command to execute changes.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
