If you want to set the child window to display RU.resx resources. For setting up and using resources, you could try to refer to the following methods.
Project structure:
En.resx:
RU.resx:
App.xaml.cs:
public partial class App : Application
{
public App()
{
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("RU");
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("En");
}
}
Add xmlns:res="clr-namespace:CurrentUICultureDemo.Properties"
to both MainWindow.xaml and SubWindow.xaml.
MainWindow.xaml:
<Window x:Class="CurrentUICultureDemo.MainWindow"
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:CurrentUICultureDemo"
xmlns:res="clr-namespace:CurrentUICultureDemo.Properties"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<StackPanel>
<Button x:Name = "button1" Content="{x:Static res:RU.Submit}" Width="75"/>
<Button x:Name="Button2" Content="{x:Static res:RU.Password}" Width="75" Click="Button2_Click"/>
</StackPanel>
</Window>
MainWindow.xaml.cs:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button2_Click(object sender, RoutedEventArgs e)
{
SubWindow w= new SubWindow();
w.Show();
}
}
SubWindow.xaml:
<Window x:Class="CurrentUICultureDemo.SubWindow"
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:CurrentUICultureDemo"
mc:Ignorable="d"
xmlns:res="clr-namespace:CurrentUICultureDemo.Properties"
Title="SubWindow" Height="450" Width="800">
<StackPanel>
<Button x:Name = "btn1" Content="{x:Static res:RU.Submit}" Width="75"/>
<Button x:Name = "btn2" Content="{x:Static res:En.Submit}" Width="75"/>
<Button x:Name="btn3" Content="{x:Static res:RU.Password}" Height="30" Width="75"/>
<Button x:Name="btn4" Content="{x:Static res:En.Password}" Height="30" Width="75"/>
</StackPanel>
</Window>
The result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our [documentation][5] to enable e-mail notifications if you want to receive the related email notification for this thread.
[5]: https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html