When you have folders in the project structure, you should use "/", not ".", So it is foldername/window.xaml .
(I hope this is not really called window.xaml . This is a confusing name for a type in a WPF project, because there is a built-in type called Window .)
Setting the assembly action on the resource will aggravate the situation: you used the wrong name not only, but now you have changed the assembly action to the wrong one for XAML. The correct build action for the .xaml file .xaml usually Page . ( App.xaml is an exception to this rule.) The Page assembly action forces the page to compile into a binary representation (known as BAML), and this binary format can then be loaded either by calling InitializeComponent in the codeb or through Application.LoadComponent .
Setting the build action in Resource simply inserts a copy of the XAML source directly into the project, which will not help you - you cannot work with XAML in this form if you want to have a codebehind file. (In WPF, anyway, this is not the case with other XAML-based frameworks such as WinRT.)
Since Page is the standard build action for a newly added window, you actually do not need to set any properties at all. You just need to use / for the borders of the folders.
source share