7 template <
typename TItem>
18 template <
typename TItem>
28 return self->GetItemsCount();
37 return self->GetSelectedIndex();
40 self->SetSelectedIndex(value);
49 return self->GetSelectedItem();
控件
Definition Control.h:12
值转换器接口
Definition IValueConverter.h:14
表示可用于呈现一组项的控件
Definition ItemsControl.h:20
virtual int GetItemsCount()=0
获取子项数
virtual TItem GetItemAt(int index)=0
获取指定索引处子项的值
virtual void Clear()=0
清空所有子项
virtual bool AddItem(const TItem &item)=0
添加新的子项
const ReadOnlyProperty< int > ItemsCount
项数
Definition ItemsControl.h:25
const ReadOnlyProperty< TItem > SelectedItem
选中项
Definition ItemsControl.h:46
virtual TItem GetSelectedItem()=0
获取选中项
virtual bool RemoveItemAt(int index)=0
移除指定索引处的子项
virtual void SetSelectedIndex(int index)=0
设置选中项索引
virtual void OnSelectionChanged()
选中项改变时调用该函数
Definition ItemsControl.h:56
virtual bool InsertItem(int index, const TItem &item)=0
添加子项到指定索引
virtual int GetSelectedIndex()=0
选中项的索引,当无选中项时为-1
const Property< int > SelectedIndex
选中项的索引,当无选中项时为-1
Definition ItemsControl.h:34
virtual bool UpdateItem(int index, const TItem &newValue)=0
更新指定位置的子项
void RaisePropertyChanged(FieldId propertyId)
触发属性更改通知事件
Definition ObservableObject.h:61
static StaticPropertyInitializer< T > Init()
获取静态属性初始化器
Definition Property.h:1523
void RaiseRoutedEvent(RoutedEventType eventType)
触发路由事件
SimpleWindow框架的顶级命名空间,所有公共类型、控件、枚举和工具函数均定义于此。
Definition Alignment.h:4
ItemsControl< std::wstring > StrItemsControl
表示可用于呈现一组字符串的控件
Definition ItemsControl.h:13
@ ItemsControl_SelectionChanged
列表视图/列表框/组合框的选中项改变,参数类型为sw::RoutedEventArgs
Definition RoutedEvent.h:89