3#include "RoutedEvent.h"
12 typename std::enable_if<std::is_base_of<RoutedEventArgs, TEventArgs>::value,
int>::type = 0>
36 if (_handler) _handler(sender,
static_cast<TEventArgs &
>(args));
50 virtual std::type_index
GetType()
const override
65 if (
GetType() != other.GetType()) {
69 return _handler.Equals(otherWrapper._handler);
路由事件处理函数包装类,用于需要转换RoutedEventArgs为特定事件参数类型的情况
Definition EventHandlerWrapper.h:14
virtual void Invoke(UIElement &sender, RoutedEventArgs &args) const override
调用事件处理函数
Definition EventHandlerWrapper.h:34
RoutedEventHandlerWrapper(const Action< UIElement &, TEventArgs & > &handler)
构造函数
Definition EventHandlerWrapper.h:26
virtual std::type_index GetType() const override
获取当前可调用对象的类型信息
Definition EventHandlerWrapper.h:50
virtual bool Equals(const ICallable< void(UIElement &, RoutedEventArgs &)> &other) const override
判断当前可调用对象是否与另一个可调用对象相等
Definition EventHandlerWrapper.h:60
virtual ICallable< void(UIElement &, RoutedEventArgs &)> * Clone() const override
克隆当前可调用对象
Definition EventHandlerWrapper.h:42
表示界面中的元素
Definition UIElement.h:90
路由事件的参数
Definition RoutedEvent.h:149