XAML Build Alias

We used WPFToolKit and PresentationFramework 4.0 in our project. There are several common namespaces in both libraries (assemblies). To resolve namespace conflicts, we provided the alias WPFToolKit, which helped in coding behind (.cs files)

Now in our XAML files, as we specify an alias.

WPFToolKit DataGrid not recognized

Error: The type or name of the Controls namespace does not exist in the Microsoft.Windows namespace (do you miss the assembly reference?)

XAML namespace code

xmlns:WpfToolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" 

XAML DataGrid

 <WpfToolkit:DataGrid Name="BlotterGrid" /> 
+5
source share
3 answers

Build errors were resolved using Alias ​​as "global, MyAlias" rather than "MyAlias". Thus, the external alias "MyAlias" is used in the code file, while the global is used in XAML.

Link: http://social.msdn.microsoft.com/Forums/da-DK/vseditor/thread/87f0caa0-c57a-4146-a999-c794947ae28e

+2
source

Sort of:

 <Window x:Class="New_Project.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkit="clr-namespace:WPFToolKit " Title="MainWindow" Height="350" Width="525"> <StackPanel> <toolkit:DataGrid/> </StackPanel> </Window> 
0
source

The XAML alias for the referenced DLL (assembly) defines this:

 xmlns:MvvmFramework="clr-namespace:NamespaceName.MvvmFramework.Mvvm;assembly=MvvmFramework" 

In this case, the assembly reference is MvvmFramework.dll

0
source

Source: https://habr.com/ru/post/921864/


All Articles