Standard-Culture definieren

Der folgende Aufruf definiert die aktuelle System-Sprache als aktive Culture innerhalb der gesamten Applikation.

public partial class App : Application
{
    static App()
    {
        FrameworkElement.LanguageProperty.OverrideMetadata(
             typeof (FrameworkElement),
             new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name)));
    }
}

Soll die Culture-Zuweisung nur für ein Window gelten, kann die vereinfachte Zuweisung verwendet werden:

<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:t="clr-namespace:System.Threading;assembly=System"
    Title="Window1" Height="300" Width="300"
    xml:lang="fr-FR">
Kommentare sind geschlossen

Tags