ModelService.Find 方法 (ModelItem, Type)

[本文档仅供预览,在以后的发行版中可能会发生更改。包含的空白主题用作占位符。]

在派生类中重写时,为指定的起点查找匹配的模型项。

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

语法

声明
Public MustOverride Function Find ( _
    startingItem As ModelItem, _
    type As Type _
) As IEnumerable(Of ModelItem)
public abstract IEnumerable<ModelItem> Find(
    ModelItem startingItem,
    Type type
)
public:
virtual IEnumerable<ModelItem^>^ Find(
    ModelItem^ startingItem, 
    Type^ type
) abstract
abstract Find : 
        startingItem:ModelItem * 
        type:Type -> IEnumerable<ModelItem> 
public abstract function Find(
    startingItem : ModelItem, 
    type : Type
) : IEnumerable<ModelItem>

参数

  • startingItem
    类型:Microsoft.Windows.Design.Model.ModelItem
    要从其开始搜索的模型项。此项上面的项将被忽略。此项以及层次结构中位于此项下面的任何项都将包括在搜索中。如果此参数为 nulla null reference (Nothing in Visual Basic),则使用根。
  • type
    类型:System.Type
    要查找的对象的类型。

返回值

类型:System.Collections.Generic.IEnumerable<ModelItem>
与查询匹配的模型项的枚举。

异常

异常 条件
ArgumentNullException

type 为 nulla null reference (Nothing in Visual Basic)。

备注

Find 方法枚举请求类型的指定父范围的所有项。

编辑模型的所有遍历是递归的。

.NET Framework 安全性

请参见

参考

ModelService 类

Find 重载

Microsoft.Windows.Design.Services 命名空间

ModelItem

其他资源

编辑模型体系结构

WPF 设计器扩展性