I'm creating a class library that makes available some XAML windows (in theory). To create the XAML, I right clicked on the project and then clicked Add->New Item, and then specified Window (WPF). I then created my XAML, which I had already prototyped in a stand alone application. However, when I go to build my project, I get the following error:
The type name 'MyWindow' does not exist in the type 'MyProjectName.MyProjectName'
The header of my XAML looks like the following:
<Window x:Class="MyProjectName.MyWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MyWindow" WindowStyle="ToolWindow" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded" Height="300" Width="300">
Unfortunately, it says the error is occurring on line 4 column 25, which ends up being the following unhelpful snippet w" WindowStyle=
in the XAML.
The build action for the XAML is Page
. What does this error mean and how can I fix it so my windows are available in the class library?