XAML:
<Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:uc="clr-namespace:MyApplication" Title="Window1" > ... <uc:MyUserCtrl1 /> ... </Window>
Where MyApplication is the namespace of your application.
Now if the user control is in another assembly (for example MyApplication.GUI.dll) you must also type the assembly name in the XML namespace declaration:
XAML:
<Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:uc="clr-namespace:MyApplication.GUI;assembly=MyApplication.GUI" Title="Window1" > ... <uc:MyUserCtrl1 /> ... </Window>
Note that the assembly name may be different from the namespace!
0 коментара:
Post a Comment