The following topic will show you how to manually declare a namespace in XAML.
Almost all Telerik controls can be found in a special URI namespace. You can use only this namespace to access all controls from Telerik assemblies that you
are referring in your application. You cannot access controls from assemblies that you are not referring.
Note |
|---|
There are only few controls which are in another namespace. These are RadPivotGrid and RadPivotFieldList and their namespace is:
xmlns:pivot="http://schemas.telerik.com/2008/xaml/presentation/pivot"
|
Create a new WPF Application.
Add references to the Telerik RadControls DLLs in the Solution Explorer.
Open the MainWindow.xaml.
Go to the Window tag and write:
CopyXAML
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Or you can select from the IntelliSense in XAML:
- The result should be similar to this.
CopyXAML
<Window x:Class="WpfApplication5.MainWindow"
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">
<Grid>
</Grid>
</Window>- Now you should be able to declare any controls existing in this namespace and which is in the assemblies you have added in your project. An example of RadTreeView declaration is shown below.
CopyXAML
<Window x:Class="WpfApplication5.MainWindow"
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">
<Grid>
<telerik:RadTreeView/>
</Grid>
</Window> Note |
|---|
If you wonder which control in which assembly belongs to, read the main topic about Controls Dependencies. |
Note |
|---|
You can add namespace declaration for specific assembly by using the following syntax:
xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation". When you use telerikNavigation in your code
you will have access only to the controls in the Telerik.Windows.Controls.Navigation assembly. We recommend you to use telerik URI namespace: xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
See Also
Other Resources
[49ED3EF3-0D10-4E1A-87D2-566C73A6E667]