C#C
C#3y ago
bribri

❔ WPF application resources not found in window

I'm doing a small project but for reason I can't use my WPF application resources in my windows. I have done it before and looking at my other projects so find what I do wrong but everything seems to be the same... I'm using a 3 layer architecture. Where my notes.startup start everything up and the start.xaml file is my wpf window. it starts the window but when I want to add a style I get an "resource could not be resolved" error. Because the window opens I guess almost everything works but I probably forgot something small
Start.xaml
<Window x:Class="Notes.Presentation.Start"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:gl="clr-namespace:System.Globalization;assembly=mscorlib"
        xmlns:local="clr-namespace:Notes.Presentation"
        mc:Ignorable="d"
        Title="Start" Height="450" Width="800"
        WindowStyle="None"
        ResizeMode="CanResizeWithGrip" 
        AllowsTransparency="True"
        Style="{StaticResource StandaardWindow}"
        >
    <Grid>
    </Grid>
</Window>


app.xaml
<Application x:Class="Notes.Startup.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:s="clr-namespace:System;assembly=System.Runtime"
             xmlns:local="clr-namespace:Notes.Startup"
             Startup="Application_Startup">
    <Application.Resources>


        <Style TargetType="Window" x:Key="StandaardWindow">
            <Setter Property="Height" Value="600"/>
            <Setter Property="Width" Value="1400"/>

        </Style>

    </Application.Resources>

</Application>
image.png
Was this page helpful?