From ca0c8ce7a016cedc4c40eecff3264782990f8cd8 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Thu, 25 Oct 2018 14:06:23 +0800
Subject: [PATCH] Demo adds language switching
---
HandyControl/Controls/Growl.cs | 6 +-
.../Themes/Styles/Base/CheckBoxBaseStyle.xaml | 2 +
.../Styles/Base/RadioButtonBaseStyle.xaml | 4 +-
HandyControl/Themes/Styles/RadioButton.xaml | 6 +-
HandyControl/Themes/Styles/ToggleButton.xaml | 2 +
HandyControl/Themes/Styles/TreeView.xaml | 1 -
HandyControlDemo/App.xaml.cs | 11 ++-
HandyControlDemo/Data/AppConfig.cs | 11 +++
HandyControlDemo/Data/GlobalData.cs | 29 +++++++
HandyControlDemo/HandyControlDemo.csproj | 75 +++++++++--------
.../Properties/Langs/Lang.Designer.cs | 45 ++++++++++
.../Properties/Langs/Lang.en.resx | 15 ++++
HandyControlDemo/Properties/Langs/Lang.resx | 15 ++++
HandyControlDemo/Resources/Img/Flag/cn.png | Bin 0 -> 1947 bytes
HandyControlDemo/Resources/Img/Flag/en.png | Bin 0 -> 1621 bytes
.../BorderElement_16x.png | Bin
.../{ => LeftMainContent}/ButtonClick_16x.png | Bin
.../{ => LeftMainContent}/Calendar_16x.png | Bin
.../{ => LeftMainContent}/Carousel_16x.png | Bin
.../{ => LeftMainContent}/CheckBox_16x.png | Bin
.../ColorPalette_16x.png | Bin
.../{ => LeftMainContent}/ComboBox_16x.png | Bin
.../{ => LeftMainContent}/ContextMenu_16x.png | Bin
.../{ => LeftMainContent}/DataGrid_16x.png | Bin
.../{ => LeftMainContent}/DatePicker_16x.png | Bin
.../{ => LeftMainContent}/Expander_16x.png | Bin
.../Img/{ => LeftMainContent}/Flow_16x.png | Bin
.../ImageBrowser_16x.png | Bin
.../Img/{ => LeftMainContent}/ListBox_16x.png | Bin
.../Loading_Blue_16x.png | Bin
.../Img/{ => LeftMainContent}/Message_16x.png | Bin
.../NumericListBox_16x.png | Bin
.../{ => LeftMainContent}/Paginator_16x.png | Bin
.../{ => LeftMainContent}/PasswordBox_16x.png | Bin
.../Img/{ => LeftMainContent}/Path_16x.png | Bin
.../{ => LeftMainContent}/ProgressBar_16x.png | Bin
.../{ => LeftMainContent}/RadioButton_16x.png | Bin
.../{ => LeftMainContent}/ScrollBox_16x.png | Bin
.../ShapeArcRing_16x.png | Bin
.../SplitterControl_16x.png | Bin
.../Img/{ => LeftMainContent}/TabPage_16x.png | Bin
.../{ => LeftMainContent}/TextBlock_16x.png | Bin
.../Img/{ => LeftMainContent}/TextBox_16x.png | Bin
.../{ => LeftMainContent}/TimePicker_16x.png | Bin
.../{ => LeftMainContent}/Time_color_16x.png | Bin
.../{ => LeftMainContent}/Timeline_16x.png | Bin
.../Img/{ => LeftMainContent}/Toggle_16x.png | Bin
.../{ => LeftMainContent}/TreeView_16x.png | Bin
.../{ => LeftMainContent}/WindowsForm_16x.png | Bin
.../UserControl/Controls/GrowlDemoCtl.xaml | 15 ++--
.../UserControl/Main/LeftMainContent.xaml | 72 ++++++++--------
.../UserControl/Main/NoUserContent.xaml | 79 +++++++++++-------
.../UserControl/Main/NoUserContent.xaml.cs | 37 +++++++-
.../ViewModel/GrowlDemoViewModel.cs | 10 +--
HandyControlDemo/packages.config | 1 +
55 files changed, 313 insertions(+), 123 deletions(-)
create mode 100644 HandyControlDemo/Data/AppConfig.cs
create mode 100644 HandyControlDemo/Data/GlobalData.cs
create mode 100644 HandyControlDemo/Resources/Img/Flag/cn.png
create mode 100644 HandyControlDemo/Resources/Img/Flag/en.png
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/BorderElement_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ButtonClick_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Calendar_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Carousel_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/CheckBox_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ColorPalette_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ComboBox_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ContextMenu_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/DataGrid_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/DatePicker_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Expander_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Flow_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ImageBrowser_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ListBox_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Loading_Blue_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Message_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/NumericListBox_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Paginator_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/PasswordBox_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Path_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ProgressBar_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/RadioButton_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ScrollBox_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/ShapeArcRing_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/SplitterControl_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/TabPage_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/TextBlock_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/TextBox_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/TimePicker_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Time_color_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Timeline_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/Toggle_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/TreeView_16x.png (100%)
rename HandyControlDemo/Resources/Img/{ => LeftMainContent}/WindowsForm_16x.png (100%)
diff --git a/HandyControl/Controls/Growl.cs b/HandyControl/Controls/Growl.cs
index 7fe15efa..b56772d7 100644
--- a/HandyControl/Controls/Growl.cs
+++ b/HandyControl/Controls/Growl.cs
@@ -388,9 +388,11 @@ namespace HandyControl.Controls
/// 询问
///
///
- public static void Ask(string message) => Ask(new GrowlInfo
+ ///
+ public static void Ask(string message, Func actionBeforeClose) => Ask(new GrowlInfo
{
- Message = message
+ Message = message,
+ ActionBeforeClose = actionBeforeClose
});
///
diff --git a/HandyControl/Themes/Styles/Base/CheckBoxBaseStyle.xaml b/HandyControl/Themes/Styles/Base/CheckBoxBaseStyle.xaml
index a3b43856..75269a20 100644
--- a/HandyControl/Themes/Styles/Base/CheckBoxBaseStyle.xaml
+++ b/HandyControl/Themes/Styles/Base/CheckBoxBaseStyle.xaml
@@ -7,6 +7,8 @@
+
+
diff --git a/HandyControl/Themes/Styles/Base/RadioButtonBaseStyle.xaml b/HandyControl/Themes/Styles/Base/RadioButtonBaseStyle.xaml
index 23567c7a..369d8dab 100644
--- a/HandyControl/Themes/Styles/Base/RadioButtonBaseStyle.xaml
+++ b/HandyControl/Themes/Styles/Base/RadioButtonBaseStyle.xaml
@@ -7,6 +7,8 @@
+
+
@@ -44,7 +46,7 @@
-
+
diff --git a/HandyControl/Themes/Styles/RadioButton.xaml b/HandyControl/Themes/Styles/RadioButton.xaml
index 673b13c2..20051738 100644
--- a/HandyControl/Themes/Styles/RadioButton.xaml
+++ b/HandyControl/Themes/Styles/RadioButton.xaml
@@ -1,9 +1,13 @@
-
+
+
+
+
\ No newline at end of file
diff --git a/HandyControl/Themes/Styles/ToggleButton.xaml b/HandyControl/Themes/Styles/ToggleButton.xaml
index a2e5213c..58670e6f 100644
--- a/HandyControl/Themes/Styles/ToggleButton.xaml
+++ b/HandyControl/Themes/Styles/ToggleButton.xaml
@@ -106,6 +106,8 @@
+
+
diff --git a/HandyControl/Themes/Styles/TreeView.xaml b/HandyControl/Themes/Styles/TreeView.xaml
index 15ac95fd..a4f59301 100644
--- a/HandyControl/Themes/Styles/TreeView.xaml
+++ b/HandyControl/Themes/Styles/TreeView.xaml
@@ -100,7 +100,6 @@
-
diff --git a/HandyControlDemo/App.xaml.cs b/HandyControlDemo/App.xaml.cs
index 2d467979..83fac9e5 100644
--- a/HandyControlDemo/App.xaml.cs
+++ b/HandyControlDemo/App.xaml.cs
@@ -1,6 +1,7 @@
using System.Globalization;
using System.Threading;
using System.Windows;
+using HandyControlDemo.Data;
namespace HandyControlDemo
{
@@ -12,7 +13,15 @@ namespace HandyControlDemo
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
- Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
+
+ GlobalData.Init();
+ Thread.CurrentThread.CurrentUICulture = new CultureInfo(GlobalData.Config.Lang);
+ }
+
+ protected override void OnExit(ExitEventArgs e)
+ {
+ base.OnExit(e);
+ GlobalData.Save();
}
}
}
diff --git a/HandyControlDemo/Data/AppConfig.cs b/HandyControlDemo/Data/AppConfig.cs
new file mode 100644
index 00000000..5ebf2226
--- /dev/null
+++ b/HandyControlDemo/Data/AppConfig.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace HandyControlDemo.Data
+{
+ internal class AppConfig
+ {
+ public static string SavePath = $"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json";
+
+ public string Lang { get; set; } = "cn";
+ }
+}
\ No newline at end of file
diff --git a/HandyControlDemo/Data/GlobalData.cs b/HandyControlDemo/Data/GlobalData.cs
new file mode 100644
index 00000000..a32bedb8
--- /dev/null
+++ b/HandyControlDemo/Data/GlobalData.cs
@@ -0,0 +1,29 @@
+using System.IO;
+using Newtonsoft.Json;
+
+namespace HandyControlDemo.Data
+{
+ internal class GlobalData
+ {
+ public static void Init()
+ {
+ if (File.Exists(AppConfig.SavePath))
+ {
+ var json = File.ReadAllText(AppConfig.SavePath);
+ Config = JsonConvert.DeserializeObject(json);
+ }
+ else
+ {
+ Config = new AppConfig();
+ }
+ }
+
+ public static void Save()
+ {
+ var json = JsonConvert.SerializeObject(Config);
+ File.WriteAllText(AppConfig.SavePath, json);
+ }
+
+ public static AppConfig Config { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/HandyControlDemo/HandyControlDemo.csproj b/HandyControlDemo/HandyControlDemo.csproj
index 4c256bb6..47698e5a 100644
--- a/HandyControlDemo/HandyControlDemo.csproj
+++ b/HandyControlDemo/HandyControlDemo.csproj
@@ -46,6 +46,9 @@
..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.Platform.dll
+
+ ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll
+
@@ -62,7 +65,9 @@
MSBuild:Compile
Designer
+
+
True
True
@@ -447,40 +452,42 @@
TextTemplatingFileGenerator
MessageToken.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HandyControlDemo/Properties/Langs/Lang.Designer.cs b/HandyControlDemo/Properties/Langs/Lang.Designer.cs
index 8a25c494..db1e9799 100644
--- a/HandyControlDemo/Properties/Langs/Lang.Designer.cs
+++ b/HandyControlDemo/Properties/Langs/Lang.Designer.cs
@@ -69,6 +69,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 询问 的本地化字符串。
+ ///
+ public static string Ask {
+ get {
+ return ResourceManager.GetString("Ask", resourceCulture);
+ }
+ }
+
///
/// 查找类似 填写基本信息 的本地化字符串。
///
@@ -123,6 +132,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 是否重启以更改语言? 的本地化字符串。
+ ///
+ public static string ChangeLangAsk {
+ get {
+ return ResourceManager.GetString("ChangeLangAsk", resourceCulture);
+ }
+ }
+
///
/// 查找类似 复选框 的本地化字符串。
///
@@ -141,6 +159,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 清空 的本地化字符串。
+ ///
+ public static string Clear {
+ get {
+ return ResourceManager.GetString("Clear", resourceCulture);
+ }
+ }
+
///
/// 查找类似 时钟 的本地化字符串。
///
@@ -240,6 +267,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 错误 的本地化字符串。
+ ///
+ public static string Error {
+ get {
+ return ResourceManager.GetString("Error", resourceCulture);
+ }
+ }
+
///
/// 查找类似 展开框 的本地化字符串。
///
@@ -249,6 +285,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 严重 的本地化字符串。
+ ///
+ public static string Fatal {
+ get {
+ return ResourceManager.GetString("Fatal", resourceCulture);
+ }
+ }
+
///
/// 查找类似 信息通知 的本地化字符串。
///
diff --git a/HandyControlDemo/Properties/Langs/Lang.en.resx b/HandyControlDemo/Properties/Langs/Lang.en.resx
index d574cc16..eab48829 100644
--- a/HandyControlDemo/Properties/Langs/Lang.en.resx
+++ b/HandyControlDemo/Properties/Langs/Lang.en.resx
@@ -345,4 +345,19 @@
Ignore
+
+ Error
+
+
+ Ask
+
+
+ Fatal
+
+
+ Clear
+
+
+ Whether to restart to change the language?
+
\ No newline at end of file
diff --git a/HandyControlDemo/Properties/Langs/Lang.resx b/HandyControlDemo/Properties/Langs/Lang.resx
index 68ed1b53..a2df44a9 100644
--- a/HandyControlDemo/Properties/Langs/Lang.resx
+++ b/HandyControlDemo/Properties/Langs/Lang.resx
@@ -325,4 +325,19 @@
忽略
+
+ 错误
+
+
+ 询问
+
+
+ 严重
+
+
+ 清空
+
+
+ 是否重启以更改语言?
+
\ No newline at end of file
diff --git a/HandyControlDemo/Resources/Img/Flag/cn.png b/HandyControlDemo/Resources/Img/Flag/cn.png
new file mode 100644
index 0000000000000000000000000000000000000000..63267f703d69537ea333b4cb5269d653e04b4904
GIT binary patch
literal 1947
zcmaJ?c~BE~6ix_&L{kemD2TcZ){5o?5|T(1%z-FD2%vaygk(t~CW!H_j~ic@0~lF6&T=)K|7%l
z2n5D&DVq;VF8mNDTEXv#KQ21J!V%(xLBWa`C{dsS5k4YCGzj>~1Y(d63PefqH$g81
z0yRe(5(b6w{24-pj36-k5HvC+j7A{57HgCOVJrv%(V$o=XJQBHu3!PFh>2ZA;gNVs
z7ATP}O;&-y$pIn4cST~!ASm28b6wAbZ
zO)88R2(T0?5TFp;@j?=r3{a^AvIm7qCF1}$64{MNf^RCG?7^T=8E&4yw+jnLQ;A|2
zd^Y!6EcnF4N+3wdAQBT36A6j#1cgdWB-811Gl!cS9`?YiljM*C7piVYAG3upSZ1etP-R<8cmCb(fljX+5x6G-NgMjd&)|96$i#=O-KAN-#0
ze-f)hl9V8k52_U#R6=-gF)rp%N(M^>3Lu3lM4^Zq?P8!r0V&iHg%V%|Q-OIrflw+p
z8(hC2csz!mTn!22LeP)R#KIf|sZ_*R!lBVUJ={D=6b_e6=D5@8BpQvx;ZS^Fg~cI_
zV%ZAe1{o-aMzNyrSlYN)^D@YkaAY>9k|uy6u1X;Tz7)-nj-Lxe%AKhq2WMBK3T-Q0-f3S0E+F4JB1PkY7{p+JN2qNUzt0bo%c+(4J0p^j=siukNgVq(e7cqE>rm
zf|a^8;@Sv`#p;;%7U>2aNlVF^m@xx`;kHs3(L=oAL>Je06E{ZM!W*g#xD)i&xox^RLDok6
zgJ-EbvK`6m#QBH05!*-r8ufS|>Tt>t9jo7O%PHGm3a;LyanyIpqb|jr(Ad6fwo|s;
zwg~Ux9J-|uxoaB$|Yux9N8CBFuNx-}ndJRjz36
z(?j7ig)at*0`wyf0f}Mi+~Q!1%GlzpA6@Icey;4Fpvwg8vyz24?
zn*~PBo)!C_a1LwrESs~MN!6+65B`L#Z;ojTu5=vAn-qA`uO|VOz3}Do11S~nr&DU?
z1TwPEVB`50dmnDq_&OpdWbD1L@v60N{Q0OUa~t!nt$N{r{Iqd+_q&6L-qVT2_lu5U
zNEsWaJ>}l6ld0F+Xmd@Mkyxf{bw$aI1(U3D&NddgTjes>Ef$AHq<1WFs)|&ShR^e_
zF?HP|K~owFVu+YVWZd2Jz2)sPSIMW#fG&6UvW#e^1IolbnqQ~cTtB@3Ap|5#4EFKP
z%a)-`kC%B?vUSJ%Kd5SMWKXSZ9l^(I5f!1#8CA_g72);%7Js!20JWjSqV-MXY(T%1
zWS48{@?GT2Z1T)1HSnFA(z^nqr_lDC+QrH`&>8irB(e|(e?0PO*#oYFw|3dAyLsw$
zon6}G`YXO^2$PfM^Uj(u++OWlpFx)-hu5rhBmxKy|6%)3x1;%Y>Bk9RS1pO!@((;+
B5?=rS
literal 0
HcmV?d00001
diff --git a/HandyControlDemo/Resources/Img/Flag/en.png b/HandyControlDemo/Resources/Img/Flag/en.png
new file mode 100644
index 0000000000000000000000000000000000000000..18425bc6e1af6c32ee965463f6ab2832f6e06cf9
GIT binary patch
literal 1621
zcmeAS@N?(olHy`uVBq!ia0vp^Za}Qh!3HGbuI>>7Qj#UE5hcO-X(i=}MX3yqDfvmM
z3ZA)%>8U}fi7AzZCsS=07?@QuLn2Bde0{8v^Kf6`()~Xj@TAnpKdC8`Lf!&sHg;q@=(~U%$M(
zT(8_%FTW^V-_X+15@d#vkuFe$ZgFK^Nn(X=Ua>OF1ees}+T7#d8#0MoBXEYLU9GXQxBrqI_HztY@Xxa#7Ppj3o=u^L<)Qdy9y
zACy|0Us{w5jJPyqkW~d%&PAz-CHX}m`T04pPz=b(FUc>?$S+WE4mMNJ@J&q4%mWE%
zf_3=%T6yLbmn7yTr+T{BDgn*V%gju%ay2q@vvf5vGca{^F*I~FwzM>`urP3SHFX3s
zoLvoIdR_99OLJ56N?>|ZKzhyGoSY0yOmON2C5GGrpv^9+MVV!(DQ-pixe8!UTV>*Q
z3vTnEdQ-5u1>z4=oNmzvIz}H9wMbD769T3m5EGtofgE_!Pt60S_ab1z=I~+WWnf@B
z?&;zfQgQ3eZ0`(VM~UPABexfR*4SpYZJF=JEg5UCH79Hh4H3}1)ch^r&CwUW-1AuY
z<@Qv32w*wb+^@h9H8n_IYf-46{K5c7!4Q#KF;^0LJy+#QU4Hh`{G^$w%Lz3BkFw|d
z^=X@}jScMg{e3pk<+|~UL-x1a?cCm}T%TB~F{$ky&mxv73e_hbr?6L+d~8&hE>t<=
zPsbhaxL6+zRh79m*WxPQ^fWfw3OwZsKl%4T5|2`fb@z0sczKl&`
zM(iBtX}csOycKm{uhuSDc79cu!B(e*y5(DDZCHA92FnsBPS)m^8D^@d@8+h3w)r?F
zXsI&h@&#;Zj`S(v!i^`
za1?%J3uZF7ah%yIURSCXZ)R}ZSpHGxA1mH7#|x`cxRQk(zn=5@
ze*fHqH+SVbj!n7vk#&(p<>}u3O0~zEeD*z_>=;w-r~T@~o#y!kzm;!A9=EVR|8$M9
z`}%;L?q2^cZ*5A}-n*h%W5wed?~hFRwR@LvoMD^Y@;$!T{p_EIk6$rd&WmRHtSxc)
z?Z(UkeEp=_xm9$NZkFMb8$x>Rj*RWEg>-stcy`Cz=&+60u*cfhYm_DUm
zV$Qy`p*QZNEZJT6wjr^5o45boiXVAmo&R-M+B2?I{nKp7)m6)VIzxH-{wHe=FU#Ei
ze|uTK>=p&Sw&sTk7BiB(#CckUWtjUVAOavt^Z4D;mGhT;>;Ng)#QylP#HJ_d33GrE
z7-wh@Zqcq|DKSI+$?Q3)a^
literal 0
HcmV?d00001
diff --git a/HandyControlDemo/Resources/Img/BorderElement_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/BorderElement_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/BorderElement_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/BorderElement_16x.png
diff --git a/HandyControlDemo/Resources/Img/ButtonClick_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ButtonClick_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ButtonClick_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ButtonClick_16x.png
diff --git a/HandyControlDemo/Resources/Img/Calendar_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Calendar_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Calendar_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Calendar_16x.png
diff --git a/HandyControlDemo/Resources/Img/Carousel_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Carousel_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Carousel_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Carousel_16x.png
diff --git a/HandyControlDemo/Resources/Img/CheckBox_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/CheckBox_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/CheckBox_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/CheckBox_16x.png
diff --git a/HandyControlDemo/Resources/Img/ColorPalette_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ColorPalette_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ColorPalette_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ColorPalette_16x.png
diff --git a/HandyControlDemo/Resources/Img/ComboBox_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ComboBox_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ComboBox_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ComboBox_16x.png
diff --git a/HandyControlDemo/Resources/Img/ContextMenu_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ContextMenu_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ContextMenu_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ContextMenu_16x.png
diff --git a/HandyControlDemo/Resources/Img/DataGrid_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/DataGrid_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/DataGrid_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/DataGrid_16x.png
diff --git a/HandyControlDemo/Resources/Img/DatePicker_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/DatePicker_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/DatePicker_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/DatePicker_16x.png
diff --git a/HandyControlDemo/Resources/Img/Expander_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Expander_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Expander_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Expander_16x.png
diff --git a/HandyControlDemo/Resources/Img/Flow_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Flow_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Flow_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Flow_16x.png
diff --git a/HandyControlDemo/Resources/Img/ImageBrowser_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ImageBrowser_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ImageBrowser_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ImageBrowser_16x.png
diff --git a/HandyControlDemo/Resources/Img/ListBox_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ListBox_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ListBox_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ListBox_16x.png
diff --git a/HandyControlDemo/Resources/Img/Loading_Blue_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Loading_Blue_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Loading_Blue_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Loading_Blue_16x.png
diff --git a/HandyControlDemo/Resources/Img/Message_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Message_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Message_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Message_16x.png
diff --git a/HandyControlDemo/Resources/Img/NumericListBox_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/NumericListBox_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/NumericListBox_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/NumericListBox_16x.png
diff --git a/HandyControlDemo/Resources/Img/Paginator_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Paginator_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Paginator_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Paginator_16x.png
diff --git a/HandyControlDemo/Resources/Img/PasswordBox_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/PasswordBox_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/PasswordBox_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/PasswordBox_16x.png
diff --git a/HandyControlDemo/Resources/Img/Path_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Path_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Path_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Path_16x.png
diff --git a/HandyControlDemo/Resources/Img/ProgressBar_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ProgressBar_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ProgressBar_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ProgressBar_16x.png
diff --git a/HandyControlDemo/Resources/Img/RadioButton_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/RadioButton_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/RadioButton_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/RadioButton_16x.png
diff --git a/HandyControlDemo/Resources/Img/ScrollBox_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ScrollBox_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ScrollBox_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ScrollBox_16x.png
diff --git a/HandyControlDemo/Resources/Img/ShapeArcRing_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/ShapeArcRing_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/ShapeArcRing_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/ShapeArcRing_16x.png
diff --git a/HandyControlDemo/Resources/Img/SplitterControl_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/SplitterControl_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/SplitterControl_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/SplitterControl_16x.png
diff --git a/HandyControlDemo/Resources/Img/TabPage_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/TabPage_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/TabPage_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/TabPage_16x.png
diff --git a/HandyControlDemo/Resources/Img/TextBlock_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/TextBlock_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/TextBlock_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/TextBlock_16x.png
diff --git a/HandyControlDemo/Resources/Img/TextBox_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/TextBox_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/TextBox_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/TextBox_16x.png
diff --git a/HandyControlDemo/Resources/Img/TimePicker_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/TimePicker_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/TimePicker_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/TimePicker_16x.png
diff --git a/HandyControlDemo/Resources/Img/Time_color_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Time_color_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Time_color_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Time_color_16x.png
diff --git a/HandyControlDemo/Resources/Img/Timeline_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Timeline_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Timeline_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Timeline_16x.png
diff --git a/HandyControlDemo/Resources/Img/Toggle_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/Toggle_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/Toggle_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/Toggle_16x.png
diff --git a/HandyControlDemo/Resources/Img/TreeView_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/TreeView_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/TreeView_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/TreeView_16x.png
diff --git a/HandyControlDemo/Resources/Img/WindowsForm_16x.png b/HandyControlDemo/Resources/Img/LeftMainContent/WindowsForm_16x.png
similarity index 100%
rename from HandyControlDemo/Resources/Img/WindowsForm_16x.png
rename to HandyControlDemo/Resources/Img/LeftMainContent/WindowsForm_16x.png
diff --git a/HandyControlDemo/UserControl/Controls/GrowlDemoCtl.xaml b/HandyControlDemo/UserControl/Controls/GrowlDemoCtl.xaml
index faff8901..0f813ec7 100644
--- a/HandyControlDemo/UserControl/Controls/GrowlDemoCtl.xaml
+++ b/HandyControlDemo/UserControl/Controls/GrowlDemoCtl.xaml
@@ -2,17 +2,18 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
+ xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
DataContext="{Binding GrowlDemo,Source={StaticResource Locator}}"
Background="White">
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/HandyControlDemo/UserControl/Main/LeftMainContent.xaml b/HandyControlDemo/UserControl/Main/LeftMainContent.xaml
index ad21c087..677fa899 100644
--- a/HandyControlDemo/UserControl/Main/LeftMainContent.xaml
+++ b/HandyControlDemo/UserControl/Main/LeftMainContent.xaml
@@ -17,97 +17,97 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -116,87 +116,87 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/HandyControlDemo/UserControl/Main/NoUserContent.xaml b/HandyControlDemo/UserControl/Main/NoUserContent.xaml
index bc77a5db..aee5a4ce 100644
--- a/HandyControlDemo/UserControl/Main/NoUserContent.xaml
+++ b/HandyControlDemo/UserControl/Main/NoUserContent.xaml
@@ -1,30 +1,51 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HandyControlDemo/UserControl/Main/NoUserContent.xaml.cs b/HandyControlDemo/UserControl/Main/NoUserContent.xaml.cs
index 0242de49..d6efb4c9 100644
--- a/HandyControlDemo/UserControl/Main/NoUserContent.xaml.cs
+++ b/HandyControlDemo/UserControl/Main/NoUserContent.xaml.cs
@@ -1,14 +1,43 @@
-// ReSharper disable once CheckNamespace
+using System;
+using System.Diagnostics;
+using System.Reflection;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using HandyControl.Controls;
+using HandyControlDemo.Data;
+
+// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
{
- ///
- /// NoUserContent.xaml 的交互逻辑
- ///
public partial class NoUserContent
{
public NoUserContent()
{
InitializeComponent();
+
+ ImageLang.Source = BitmapFrame.Create(new Uri($"pack://application:,,,/HandyControlDemo;component/Resources/Img/Flag/{GlobalData.Config.Lang}.png"));
+ }
+
+ private void ButtonLang_OnClick(object sender, RoutedEventArgs e) => PopupLang.IsOpen = true;
+
+ private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (e.OriginalSource is Button button && button.Tag is string tag)
+ {
+ PopupLang.IsOpen = false;
+ if (tag.Equals(GlobalData.Config.Lang)) return;
+ Growl.Ask(Properties.Langs.Lang.ChangeLangAsk, b =>
+ {
+ if (!b) return true;
+ GlobalData.Config.Lang = tag;
+ GlobalData.Save();
+ Process.Start(Assembly.GetExecutingAssembly().Location);
+ Environment.Exit(0);
+ return true;
+ });
+ }
}
}
}
diff --git a/HandyControlDemo/ViewModel/GrowlDemoViewModel.cs b/HandyControlDemo/ViewModel/GrowlDemoViewModel.cs
index 8ada523e..e752c50c 100644
--- a/HandyControlDemo/ViewModel/GrowlDemoViewModel.cs
+++ b/HandyControlDemo/ViewModel/GrowlDemoViewModel.cs
@@ -29,14 +29,10 @@ namespace HandyControlDemo.ViewModel
new RelayCommand(() => Growl.Error(Properties.Langs.Lang.GrowlError))).Value;
public RelayCommand AskCmd => new Lazy(() =>
- new RelayCommand(() => Growl.Ask(new GrowlInfo
+ new RelayCommand(() => Growl.Ask(Properties.Langs.Lang.GrowlAsk, isConfirmed =>
{
- Message = Properties.Langs.Lang.GrowlAsk,
- ActionBeforeClose = isConfirmed =>
- {
- Growl.Info(isConfirmed.ToString());
- return true;
- }
+ Growl.Info(isConfirmed.ToString());
+ return true;
}))).Value;
public RelayCommand FatalCmd => new Lazy(() =>
diff --git a/HandyControlDemo/packages.config b/HandyControlDemo/packages.config
index 59fa3173..d4e90a24 100644
--- a/HandyControlDemo/packages.config
+++ b/HandyControlDemo/packages.config
@@ -2,4 +2,5 @@
+
\ No newline at end of file