Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Getting an Error in x:Static in WPF Xaml ie The name Strings doesn't exist in the namespace. Everything is added . But still I am getting the error. Please someone help me in this.

What I have tried:

<UserControl x:Class="Clearcore2.VerticalApplications.Settings.View.GeneralView"
             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"
             mc:Ignorable="d" d:DesignHeight="300"
             xmlns:Settings="clr-namespace:Clearcore2.VerticalApplications.Settings" d:DesignWidth="300">

	<Grid VerticalAlignment="Top" Margin="0,10,15,0">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="30" />
		    <RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
           
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="350"></ColumnDefinition>
			<ColumnDefinition></ColumnDefinition>
		</Grid.ColumnDefinitions>

        <TextBlock Grid.Row="0" Text="{x:Static Settings:Strings.GeneralOptionsSubTitle}" Style="{DynamicResource GroupHeaderStyle}"/>

		<TextBlock Grid.Row="1" Text="{x:Static Settings:Strings.FullScreenModeText}" Style="{DynamicResource FieldHeaderStyle}" VerticalAlignment="Center"/>
Posted
Updated 1-Jun-21 4:08am
Comments
[no name] 31-May-21 13:08pm    
We can't know what your public, static "Strings" class looks like or where it is.
Gita Padhihari 7-Jun-21 3:46am    
Here strings is a resource file. I have changed the class from internal to Public. And it worked.

1 solution

Assuming Strings is a resource file, you need to change the generated class from internal to public.

To do that, open your resource file in Visual Studio, and use the "Access Modifier" dropdown in the toolbar within the resource file document to change it from "internal" to "public".
 
Share this answer
 
v2
Comments
Gita Padhihari 7-Jun-21 3:41am    
Thank you Richard Deeming

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900