lang support for binding
This commit is contained in:
1 parent
95f35c7366
commit
1680858455
20 files changed
+274
-117
No files matched your search
@@ -1,5 +1,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Properties.Langs
|
||||
@@ -10,7 +12,7 @@ namespace HandyControl.Properties.Langs
|
||||
|
||||
private static string CultureInfoStr;
|
||||
|
||||
public static CultureInfo Culture
|
||||
internal static CultureInfo Culture
|
||||
{
|
||||
get => Lang.Culture;
|
||||
set
|
||||
@@ -24,6 +26,13 @@ namespace HandyControl.Properties.Langs
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetLang(DependencyObject dependencyObject, DependencyProperty dependencyProperty, string key) =>
|
||||
BindingOperations.SetBinding(dependencyObject, dependencyProperty, new Binding(key)
|
||||
{
|
||||
Source = Instance,
|
||||
Mode = BindingMode.OneWay
|
||||
});
|
||||
|
||||
private void UpdateLangs()
|
||||
{
|
||||
OnPropertyChanged(nameof(Am));
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#>
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Properties.Langs
|
||||
@@ -29,7 +31,7 @@ namespace HandyControl.Properties.Langs
|
||||
|
||||
private static string CultureInfoStr;
|
||||
|
||||
public static CultureInfo Culture
|
||||
internal static CultureInfo Culture
|
||||
{
|
||||
get => Lang.Culture;
|
||||
set
|
||||
@@ -43,6 +45,13 @@ namespace HandyControl.Properties.Langs
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetLang(DependencyObject dependencyObject, DependencyProperty dependencyProperty, string key) =>
|
||||
BindingOperations.SetBinding(dependencyObject, dependencyProperty, new Binding(key)
|
||||
{
|
||||
Source = Instance,
|
||||
Mode = BindingMode.OneWay
|
||||
});
|
||||
|
||||
private void UpdateLangs()
|
||||
{
|
||||
<#foreach(var item in propertyNameList){#>
|
||||
|
||||
Reference in new issue
Block a user