0

I am trying to access the strings i have in the resources file.But i am getting an error in the text of the textblock.

"The name UIResources" does not exist in the "clr-namespace:ProjectName.Resources"."

The file exists and all the properties are public.What I am doing wrong?

<Window x:Class="MyApp.Project1.TestWindow"
    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:local="clr-namespace:MyApp.Project1"
    xmlns:p="clr-namespace:MyApp.Project1.Resources"
    mc:Ignorable="d"
    Title="TestWindow" Height="300" Width="300">
<Grid>
    <TextBlock Text="{x:Static p:UIResources.BARBUTTON_ABOUT}"></TextBlock>
</Grid>

Digital_Jo4
  • 56
  • 13
  • check out this answer http://stackoverflow.com/questions/28216096/wpf-the-name-does-not-exist-in-the-namespace – Justin CI Jan 21 '16 at 11:47

1 Answers1

0

You need to add

 <Window.Resources>
    <local:MyKey x:Key="key" />
</Window.Resources>
CodeConstruct
  • 290
  • 3
  • 17