有没有办法继承TriggerAction类?

发布于 2024-08-20 15:33:20 字数 289 浏览 4 评论 0原文

我对动画不感兴趣,我试图在没有关键帧的情况下设置简单的设置器动作。

我想继承TriggerAction;创建在目标上设置新值的属性,任何其他可选属性,以便我可以使用:

<EventTrigger SourceName="btn" RoutedEvent="Click">
    <BooleanActionTrigger TargetName="cb" Property="IsChecked" Value="False"/>
</EventTrigger>

I am not interested in animations and I am trying to make simple setter action to be set without key frames.

I wanted to inherit TriggerAction; make properties that set the new value on target, any additional optional properties so I can use:

<EventTrigger SourceName="btn" RoutedEvent="Click">
    <BooleanActionTrigger TargetName="cb" Property="IsChecked" Value="False"/>
</EventTrigger>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老街孤人 2024-08-27 15:33:20

您不需要安装 Expression Blend。 System.Windows.Interactivity for WPF 现已在 NuGet 上提供。只需将该 NuGet 包添加到您的项目中并编写自定义 TriggerAction

using System.Windows;
using System.Windows.Interactivity;

public class MyCustomAction : TriggerAction<DependencyObject>
{
    ...
}

You do not need to have Expression Blend installed. System.Windows.Interactivity for WPF is now available on NuGet. Simply add that NuGet package to your project and write your custom TriggerAction:

using System.Windows;
using System.Windows.Interactivity;

public class MyCustomAction : TriggerAction<DependencyObject>
{
    ...
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文