I am trying to set the x:Name attribute to the definition of a UserControl to use it for internal bindings later on:
<UserControl
x:Name="root"
x:Class="ElementManager.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
</UserControl>
It doesn't compile saying:
The type name 'UserControl1' does not exist in the type 'ElementManager.ElementManager'
If I remove the x:Name attribute, it compiles and everything works fine. Is this meant to be or am I missing something trivial?