SimpleWindow
载入中...
搜索中...
未找到
sw::ObservableObject类 参考

可观察对象基类,实现属性更改通知功能 更多...

#include <ObservableObject.h>

类 sw::ObservableObject 继承关系图:
sw::DynamicObject sw::INotifyObjectDead sw::INotifyPropertyChanged sw::WndBase sw::NotifyIcon sw::Timer sw::ToolTip sw::UIElement sw::BallonToolTip sw::Control sw::HwndWrapper sw::Layer sw::ItemsControl< StrList > sw::ItemsControl< TreeViewNode > sw::Animation sw::ButtonBase sw::DateTimePicker sw::HotKeyControl sw::ItemsControl< TItem > sw::MonthCalendar sw::PanelBase sw::ProgressBar sw::Slider sw::Splitter sw::StaticControl sw::StatusBar sw::SysLink sw::TabControl sw::TextBoxBase sw::PanelBase sw::Window

Protected 成员函数

void RaisePropertyChanged (FieldId propertyId)
 触发属性更改通知事件
 
template<typename T , typename TProperty >
void RaisePropertyChanged (TProperty T::*property)
 触发属性更改通知事件
 

额外继承的成员函数

- Public 成员函数 继承自 sw::DynamicObject
virtual ~DynamicObject ()=default
 析构函数
 
std::type_index GetTypeIndex () const
 获取对象的类型索引
 
template<typename T >
bool IsType (T **pout=nullptr)
 判断对象是否为指定类型
 
template<typename T >
bool IsType (const T **pout=nullptr) const
 判断对象是否为指定类型
 
template<typename T >
T & DynamicCast ()
 将对象动态转换为指定类型的引用
 
template<typename T >
const T & DynamicCast () const
 将对象动态转换为指定类型的常量引用
 
template<typename T >
auto UnsafeCast () -> typename std::enable_if< _IsStaticCastable< DynamicObject *, T * >::value, T & >::type
 将对象不安全地转换为指定类型的引用
 
template<typename T >
auto UnsafeCast () -> typename std::enable_if<!_IsStaticCastable< DynamicObject *, T * >::value, T & >::type
 将对象不安全地转换为指定类型的引用
 
template<typename T >
auto UnsafeCast () const -> typename std::enable_if< _IsStaticCastable< DynamicObject *, T * >::value, const T & >::type
 将对象不安全地转换为指定类型的引用
 
template<typename T >
auto UnsafeCast () const -> typename std::enable_if<!_IsStaticCastable< DynamicObject *, T * >::value, const T & >::type
 将对象不安全地转换为指定类型的引用
 
- Public 成员函数 继承自 sw::INotifyObjectDead
virtual ~INotifyObjectDead ()
 析构时触发对象销毁事件
 
- Public 成员函数 继承自 sw::INotifyPropertyChanged
virtual ~INotifyPropertyChanged ()=default
 默认析构函数
 
- Public 属性 继承自 sw::INotifyObjectDead
ObjectDeadEventHandler ObjectDead
 对象销毁时触发该事件
 
- Public 属性 继承自 sw::INotifyPropertyChanged
PropertyChangedEventHandler PropertyChanged
 当属性值更改时触发的事件
 

详细描述

可观察对象基类,实现属性更改通知功能

成员函数说明

◆ RaisePropertyChanged() [1/2]

void sw::ObservableObject::RaisePropertyChanged ( FieldId  propertyId)
inlineprotected

触发属性更改通知事件

参数
propertyId更改的属性ID

◆ RaisePropertyChanged() [2/2]

template<typename T , typename TProperty >
void sw::ObservableObject::RaisePropertyChanged ( TProperty T::*  property)
inlineprotected

触发属性更改通知事件

模板参数
T属性所属类类型
TProperty属性类型
参数
property更改的属性成员指针

该类的文档由以下文件生成: