ProTranslate.WinUI integrates translations with WinUI markup extensions, dependency properties, x:Bind-friendly view models, and native flow direction.
Reference the adapter from the WinUI application:
<PackageReference Include="ProTranslate.WinUI" Version="..." />
Connect services:
ProTranslate.WinUI.TranslationService.UseService(translations, cultures);
With Microsoft.Extensions:
services.AddProTranslateWinUI();
using ServiceProvider serviceProvider = services.BuildServiceProvider();
serviceProvider.UseProTranslateWinUI();
WinUI does not expose an assembly-level XmlnsDefinitionAttribute for adapter libraries. Use using::
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pt="using:ProTranslate.WinUI">
<TextBlock Text="{pt:T AppTitle}" />
</Window>
x:BindThe WinUI sample uses x:Bind for strongly typed view-model properties. Static catalog text comes from generated ProTranslateStrings exposed through the view model:
<TextBlock Text="{x:Bind ViewModel.Strings.AppTitle, Mode=OneWay}" />
Use pt:T for concise view-only labels. Prefer generated ProTranslateStrings, generated constants, or generated accessors for strongly typed key paths in code and for trimming-sensitive views.
<StackPanel pt:Translation.Culture="{x:Bind ViewModel.Strings.Culture, Mode=OneWay}"
pt:Translation.AutoFlowDirection="True">
<TextBlock Text="{pt:T AppTitle}" />
</StackPanel>
WinUI does not provide the same native MultiBinding surface as Avalonia, WPF, and MAUI. The adapter preserves Value={Binding ...} by returning that binding with a formatting converter, while larger formatted workflows should normally stay in x:Bind view-model properties:
<TextBlock Text="{x:Bind ViewModel.InvoiceTotalText, Mode=OneWay}" />
WinUI sample builds are validated on Windows CI:
dotnet build samples/ProTranslate.WinUI.Sample/ProTranslate.WinUI.Sample.csproj -c Release
Non-Windows builds use a stub project path so the repository can restore and inspect on macOS/Linux.
using:ProTranslate.WinUI; the shared URI is not supported by Windows App SDK assembly attributes.x:Bind consumes derived values.