WPF 路由事件和附加事件简明教程

WPF 路由事件和附加事件简明教程

独立观察员 2023 年 4 月 27 日

一、路由事件

1.1、定义

概括:可在 WPF 元素树中传递的事件,支持界面绑定处理方法。

代码:

public static readonly RoutedEvent TapEvent = EventManager.RegisterRoutedEvent("Tap", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(OwnerType));
/// <summary>
/// [路由事件]注释
/// </summary>
public event RoutedEventHandler Tap { add => AddHandler(TapEvent, 
… 阅读全文

【翻译】WPF 中附加行为的介绍 Introduction to Attached Behaviors in WPF

【翻译】WPF 中附加行为的介绍 Introduction to Attached Behaviors in WPF

作者: 2008.08.30

翻译:独立观察员 2021.03.17

原文地址:https://www.codeproject.com/Articles/28959/Introduction-to-Attached-Behaviors-in-WPF

 

Explains the concept of attached behaviors and shows how to use them in the context of the MVVM pattern.

 

解释

… 阅读全文