Permalink
Browse files

illustrate culture info in WPF. fixes #580

1 parent 96621ce commit 879f537755560b176725e2748fe48378b7117d88 @ButchersBoy committed Dec 20, 2016
Showing with 15 additions and 0 deletions.
  1. +15 −0 MainDemo.Wpf/App.xaml.cs
@@ -2,9 +2,12 @@
using System.Collections.Generic;
using System.Configuration;
using System.Data;
+using System.Globalization;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows;
+using System.Windows.Markup;
namespace MaterialDesignColors.WpfExample
{
@@ -13,5 +16,17 @@ namespace MaterialDesignColors.WpfExample
/// </summary>
public partial class App : Application
{
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ //Illustration of setting culture info fully in WPF:
+ /*
+ Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
+ Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");
+ FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
+ XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
+ */
+
+ base.OnStartup(e);
+ }
}
}

0 comments on commit 879f537

Please sign in to comment.