如何动态绑定命令?

时间:2019-01-10 23:16:45

标签: c# xaml dynamic binding command

我不知道如何动态绑定命令。 我试图使c#等同于以下xaml代码:

^/[a-z]+/?$

(xmlns:i =“ http://schemas.microsoft.com/expression/2010/interactivity”)

但是当我不得不转换时会出现问题:

<Grid Name="grid">
   <i:Interaction.Triggers>
      <i:EventTrigger EventName="Drop">
            <i:InvokeCommandAction Command="{Binding DropCommand}/>
      </i:EventTrigger>
   </i:Interaction.Triggers>
</Grid>

...到C#代码。 我现在拥有的是:

Command="{Binding DropCommand}

0 个答案:

没有答案