I'm not sure why I get this error and I have been trying a bunch of stuff.
I have this WPF UserControl that I am building:
<UserControl x:Class="OrderPlugin.Views.OrderListUserControl"
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"
xmlns:wpf="clr-namespace:Material.Icons.WPF;assembly=Material.Icons.WPF"
xmlns:OrderPlugin="clr-namespace:OrderPlugin"
xmlns:converters="clr-namespace:Core.UI.Converters;assembly=Core.UI"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="250" MinWidth="250" >
</UserControl>
This builds fine. I can start my application, see the controls. I can interact with this and any bindings to viewmodel is working without issue. Then I subscribe to an event:
<UserControl x:Class="OrderPlugin.Views.OrderListUserControl"
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"
xmlns:wpf="clr-namespace:Material.Icons.WPF;assembly=Material.Icons.WPF"
xmlns:OrderPlugin="clr-namespace:OrderPlugin"
xmlns:converters="clr-namespace:Core.UI.Converters;assembly=Core.UI"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="250" MinWidth="250" Loaded="OrderListUserControl_OnLoaded" >
</UserControl>
And when I Build i get the error:
Error CS0426 : The type name 'Views' does not exist in the type 'OrderPlugin'
Why? I have done this in other plugins project and user controls and it works fine there.
What I have tried:
I have tried cleaning my project. I have made sure the csproj file looks the same as the others that works fine.
I have tried moving the files to the root of the project, but that just moved the problem:
Error CS0426 : The type name 'OrderListUserControl' does not exist in the type 'OrderPlugin'
So it seems if the UserControl is in its own folder/namespace does not really affect it.
So how does the reference get broken because I add an event?