我应该如何在 netcore 3.0 中绑定(bind)事件?
在 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)中绑定(bind)事件?
最佳答案
您应该可以为此使用鼠标绑定(bind)。
<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
关于c# - 我应该如何在 .net core 3.0 中绑定(bind)来自 WPF 的 xaml 事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56274569/