用于WPF的Telerik UI免费下载30天试用版

名称空间声明

下面的主题将向您展示如何在XAML中手动声明名称空间。

几乎所有的Telerik控件都可以在“Telerik”URI命名空间模式中找到(参见示例1)。您只能使用该命名空间访问应用程序中引用的Telerik程序集中的所有控件。您无法从未引用的程序集中访问控件。

很少有控件位于另一个名称空间中。例如,RadPivotGrid和RadPivotFieldList,它们的命名空间是:xmlns:pivot="http://schemas.telerik.com/2008/xaml/presentation/pivot”。

  1. 新建一个应用程序

  2. 添加对Telerik dll在解决方案资源管理器中。

    常用安装命名空间声明0”></p></li>
         </ol>
         <ul>
          <li><p>打开<strong>MainWindow.xaml</strong>.</p></li>
          <li><p>去<strong>窗口</strong>标记并添加以下名称空间。</p><p></p><h4><strong>示例1:Telerik名称空间定义</strong></h4>
           <div class=

    xmlns: telerik = "http://schemas.telerik.com/2008/xaml/presentation
或者从XAML的智能感知中选择它。

常用安装命名空间声明”></p></li>
          <li><p>结果应该与下面类似。</p><p></p><h4><strong>示例2:在XAML中添加Telerik名称空间</strong></h4>
           <div class=

< x:窗口类= " WpfApplication1。主窗口" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation“xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml“xmlns: telerik = "http://schemas.telerik.com/2008/xaml/presentation   
  • 现在您应该能够声明任何控件(存在于Telerik名称空间中),这些控件包含在您添加到项目的程序集中。下面显示了一个RadTreeView声明的例子。

    示例3:使用Telerik名称空间

    < x:窗口类= " WpfApplication1。主窗口" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation“xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml“xmlns: telerik = "http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525">    
  • 中每个控件所需的Telerik组件控制依赖关系篇文章。

    另请参阅

    在本文中
    Baidu
    map