ModelService.FromName 方法 (ModelItem, String)

使用指定的名称在指定范围内查找模型项。

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

语法

声明
Public Function FromName ( _
    scope As ModelItem, _
    name As String _
) As ModelItem
public ModelItem FromName(
    ModelItem scope,
    string name
)
public:
ModelItem^ FromName(
    ModelItem^ scope, 
    String^ name
)
member FromName : 
        scope:ModelItem * 
        name:string -> ModelItem 
public function FromName(
    scope : ModelItem, 
    name : String
) : ModelItem

参数

返回值

类型:Microsoft.Windows.Design.Model.ModelItem
其名称与 name 匹配的模型项;如果未找到匹配项,则为 nullnull 引用(在 Visual Basic 中为 Nothing)。

备注

如果未提供 scope,则根元素被用作范围。 如果提供了 scope,则将层次结构中的最近 INameScope 接口用于定位项。

.NET Framework 安全性

请参见

参考

ModelService 类

FromName 重载

Microsoft.Windows.Design.Services 命名空间

ModelItem

ViewService

DesignerView

ContextItemManager

其他资源

编辑模型体系结构

WPF 设计器扩展性