SelectionPolicy.GetPolicyItems 方法

从指定的选择中返回策略项。

命名空间:  Microsoft.Windows.Design.Policies
程序集:  Microsoft.Windows.Design.Interaction(在 Microsoft.Windows.Design.Interaction.dll 中)

语法

声明
Protected Overridable Function GetPolicyItems ( _
    selection As Selection _
) As IEnumerable(Of ModelItem)
protected virtual IEnumerable<ModelItem> GetPolicyItems(
    Selection selection
)
protected:
virtual IEnumerable<ModelItem^>^ GetPolicyItems(
    Selection^ selection
)
abstract GetPolicyItems : 
        selection:Selection -> IEnumerable<ModelItem> 
override GetPolicyItems : 
        selection:Selection -> IEnumerable<ModelItem> 
protected function GetPolicyItems(
    selection : Selection
) : IEnumerable<ModelItem>

参数

返回值

类型:System.Collections.Generic.IEnumerable<ModelItem>
用于此策略的 ModelItem 对象的枚举。

备注

使用策略逻辑重写此方法以筛选选择项。

默认行为为选中的每一项调用 IsInPolicy 方法。 其中 IsInPolicy 返回 true 的项包括在返回的枚举中。

.NET Framework 安全性

请参见

参考

SelectionPolicy 类

Microsoft.Windows.Design.Policies 命名空间

ItemPolicy

FeatureProvider

FeatureConnector<TFeatureProviderType>

其他资源

功能提供程序和功能连接器

了解 WPF 设计器扩展性