Skip to content

Commit 879f537

Browse files
committed
illustrate culture info in WPF. fixes #580
1 parent 96621ce commit 879f537

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

MainDemo.Wpf/App.xaml.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
using System.Collections.Generic;
33
using System.Configuration;
44
using System.Data;
5+
using System.Globalization;
56
using System.Linq;
7+
using System.Threading;
68
using System.Threading.Tasks;
79
using System.Windows;
10+
using System.Windows.Markup;
811

912
namespace MaterialDesignColors.WpfExample
1013
{
@@ -13,5 +16,17 @@ namespace MaterialDesignColors.WpfExample
1316
/// </summary>
1417
public partial class App : Application
1518
{
19+
protected override void OnStartup(StartupEventArgs e)
20+
{
21+
//Illustration of setting culture info fully in WPF:
22+
/*
23+
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
24+
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");
25+
FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
26+
XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
27+
*/
28+
29+
base.OnStartup(e);
30+
}
1631
}
1732
}

0 commit comments

Comments
 (0)