我应该如何从.NET Core 3.0中的WPF绑定XAML事件



我应该如何在NetCore 3.0中绑定事件?在WPF项目(NetCore3.0(中,没有类型的Interactive.dll可以做

<i:Interaction.Triggers>
    <i:EventTrigger EventName="MouseDoubleClick">
        <i:InvokeCommandAction Command="{Binding Path=DoSomethingCommand}"/>
    </i:EventTrigger>
</i:Interaction.Triggers>

那么如何在WPF(NetCore3.0(中绑定事件?

您应该能够为此使用鼠标。

  <YourControl.InputBindings>
      <MouseBinding MouseAction="LeftDoubleClick" Command="... />
  </YourControl.InputBindings>

您打算使用DLL的方式是通过Nuget软件包-Xaml Bahaviors。

https://devblogs.microsoft.com/dotnet/open-sourcing-xaml-behaviors-for-wpf/

看到net core 3仍然只是在预览中,我认为更新此软件包可能还早。

似乎不是:

https://github.com/microsoft/xamlbehaviorswpf/issues/13

最新更新