LangRX 1.0.1

dotnet add package LangRX --version 1.0.1
                    
NuGet\Install-Package LangRX -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LangRX" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LangRX" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="LangRX" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LangRX --version 1.0.1
                    
#r "nuget: LangRX, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LangRX@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LangRX&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=LangRX&version=1.0.1
                    
Install as a Cake Tool

LangRX

Dynamic localization library for WPF applications based on .resx files with runtime language switching support. No restart, no window recreation.

Highlights

  • No code tied to resources: your XAML just uses {DynamicResource KeyName}, like a normal ResourceDictionary.
  • Plays well with the designer: the dictionary auto-discovers the app's ResourceManager, so it also works in the XAML editor without running the app.
  • No extra dependencies: plain WPF.

Install

dotnet add package LangRX

Prerequisites

  • .NET Framework 4.8 or .NET 8.0-windows+, WPF.
  • Resource Files: .resx files configured with Visual Studio's default generator (ResXFileCodeGenerator), ensuring that the Properties.Resources class is available in the project.

Quick Start

1. Register the dictionary in App.xaml:

<Application xmlns:lang="clr-namespace:LangRX;assembly=LangRX"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <lang:LangRXDictionary />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

Note: If the XAML designer doesn't show the texts, pass the resources type explicitly:

xmlns:props="clr-namespace:MyApp.Properties">

<lang:LangRXDictionary ResourceType="{x:Type props:Resources}" />

2. Point it at your resources in App.xaml.cs:

public App()
{
    LangRXDictionary.Initialize(MyApp.Properties.Resources.ResourceManager);
}

3. Bind strings in XAML:

<TextBlock Text="{DynamicResource Greeting}" />
<Button Content="{DynamicResource ButtonChange}" />

4. Switch language:

Every control bound with DynamicResource repaints immediately.

LangRXDictionary.SetLanguage("en-US");   // or "es-ES"

API

Member Description
Initialize(ResourceManager) Sets the ResourceManager to populate the dictionary from.
SetLanguage(string) Switch culture by code (e.g. "en-US") and reload.
SetLanguage(CultureInfo) Same, from a CultureInfo.

SetLanguage also sets CurrentCulture/CurrentUICulture. Culture fallback follows the resx rules (e.g. en-US → en → neutral).

Demo

A runnable example lives in LangRXDemo: a button that toggles between en-US and es-ES using the neutral Resources.resx and satellite Resources.es.resx.

License

MIT — Copyright (c) 2026 Bracozs

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.
  • net10.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.
  • net9.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 90 9/11/2026