Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
ClientServerProject
提交
c27ed928
C
ClientServerProject
项目概览
jobily
/
ClientServerProject
2023-09-12 01:32:09同步失败
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClientServerProject
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c27ed928
编写于
7月 17, 2017
作者:
Richard__Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成wpf客户端对主题选择的本地存储
上级
7d394409
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
79 addition
and
31 deletion
+79
-31
CommonLibrary/BasicSupport/SoftSettings.cs
CommonLibrary/BasicSupport/SoftSettings.cs
+1
-1
软件系统客户端Wpf/App.config
软件系统客户端Wpf/App.config
+13
-0
软件系统客户端Wpf/LoginWindow.xaml.cs
软件系统客户端Wpf/LoginWindow.xaml.cs
+1
-0
软件系统客户端Wpf/MainWindow.xaml
软件系统客户端Wpf/MainWindow.xaml
+2
-2
软件系统客户端Wpf/MainWindow.xaml.cs
软件系统客户端Wpf/MainWindow.xaml.cs
+4
-0
软件系统客户端Wpf/Properties/Settings.Designer.cs
软件系统客户端Wpf/Properties/Settings.Designer.cs
+25
-17
软件系统客户端Wpf/Properties/Settings.settings
软件系统客户端Wpf/Properties/Settings.settings
+8
-5
软件系统客户端Wpf/Views/PaletteSelectorViewModel.cs
软件系统客户端Wpf/Views/PaletteSelectorViewModel.cs
+3
-3
软件系统客户端Wpf/Views/UserPaletteSelector.xaml
软件系统客户端Wpf/Views/UserPaletteSelector.xaml
+3
-2
软件系统客户端Wpf/Views/UserPaletteSelector.xaml.cs
软件系统客户端Wpf/Views/UserPaletteSelector.xaml.cs
+19
-1
未找到文件。
CommonLibrary/BasicSupport/SoftSettings.cs
浏览文件 @
c27ed928
...
...
@@ -117,7 +117,7 @@ namespace CommonLibrary
json
.
Add
(
nameof
(
IsNewVersionRunning
),
new
JValue
(
IsNewVersionRunning
));
json
.
Add
(
nameof
(
SystemInfo
),
new
JValue
(
SystemInfo
));
json
.
Add
(
nameof
(
LoginTime
),
new
JValue
(
LoginTime
));
json
.
Add
(
nameof
(
IsThemeDark
),
new
JValue
(
false
));
json
.
Add
(
nameof
(
IsThemeDark
),
new
JValue
(
IsThemeDark
));
return
json
.
ToString
();
}
public
override
void
LoadByString
(
string
content
)
...
...
软件系统客户端Wpf/App.config
浏览文件 @
c27ed928
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
configSections
>
<
sectionGroup
name
=
"userSettings"
type
=
"System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<
section
name
=
"软件系统客户端Wpf.Properties.Settings"
type
=
"System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition
=
"MachineToLocalUser"
requirePermission
=
"false"
/>
</
sectionGroup
>
</
configSections
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5"
/>
</
startup
>
<
userSettings
>
<软件系统客户端
Wpf
.
Properties
.
Settings
>
<
setting
name
=
"设置"
serializeAs
=
"String"
>
<
value
/>
</
setting
>
</软件系统客户端
Wpf
.
Properties
.
Settings
>
</
userSettings
>
</
configuration
>
\ No newline at end of file
软件系统客户端Wpf/LoginWindow.xaml.cs
浏览文件 @
c27ed928
...
...
@@ -18,6 +18,7 @@ using CommonLibrary;
using
HslCommunication.BasicFramework
;
using
Newtonsoft.Json.Linq
;
using
ClientsLibrary
;
using
MaterialDesignThemes.Wpf
;
namespace
软件系统客户端
Wpf
{
...
...
软件系统客户端Wpf/MainWindow.xaml
浏览文件 @
c27ed928
...
...
@@ -164,7 +164,7 @@
</Grid>
<Grid Width="180" DockPanel.Dock="Left">
<GroupBox Header="系统信息" Margin="
2,5
,0,0">
<GroupBox Header="系统信息" Margin="
0,0
,0,0">
<Grid>
<StackPanel>
<TextBlock>随便放点什么东西</TextBlock>
...
...
@@ -266,7 +266,7 @@
<!--主界面,应该设置成可以放置其他东西-->
<Grid>
<ContentControl Margin="3" x:Name="UserContentControl">
<ContentControl Margin="3
,0,3,0
" x:Name="UserContentControl">
</ContentControl>
</Grid>
...
...
软件系统客户端Wpf/MainWindow.xaml.cs
浏览文件 @
c27ed928
...
...
@@ -21,6 +21,7 @@ using ClientsLibrary;
using
System.Threading
;
using
软件系统客户端
Wpf.Views
;
using
System.Windows.Media.Animation
;
using
MaterialDesignThemes.Wpf
;
namespace
软件系统客户端
Wpf
{
...
...
@@ -162,6 +163,9 @@ namespace 软件系统客户端Wpf
//初始化窗口
MainRenderInitialization
();
//加载主题
new
PaletteHelper
().
SetLightDark
(
UserClient
.
JsonSettings
.
IsThemeDark
);
}
private
void
AddStringRenderShow
(
string
str
)
...
...
软件系统客户端Wpf/Properties/Settings.Designer.cs
浏览文件 @
c27ed928
//------------------------------------------------------------------------------
// <auto-generated>
//
This code was generated by a tool.
//
Runtime Version
:4.0.30319.42000
//
此代码由工具生成。
//
运行时版本
:4.0.30319.42000
//
//
Changes to this file may cause incorrect behavior and will be lost if
//
the code is regenerated.
//
对此文件的更改可能会导致不正确的行为,并且如果
//
重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace
软件系统客户端
Wpf.Properties
{
namespace
软件系统客户端
Wpf.Properties
{
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"11.0.0.0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"15.1.0.0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
public
static
Settings
Default
{
get
{
public
static
Settings
Default
{
get
{
return
defaultInstance
;
}
}
[
global
::
System
.
Configuration
.
UserScopedSettingAttribute
()]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Configuration
.
DefaultSettingValueAttribute
(
""
)]
public
string
设置
{
get
{
return
((
string
)(
this
[
"设置"
]));
}
set
{
this
[
"设置"
]
=
value
;
}
}
}
}
软件系统客户端Wpf/Properties/Settings.settings
浏览文件 @
c27ed928
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile
xmlns=
"uri:settings"
CurrentProfile=
"(Default)"
>
<Profiles>
<Profile
Name=
"(Default)"
/>
</Profiles>
<Settings
/>
<SettingsFile
xmlns=
"http://schemas.microsoft.com/VisualStudio/2004/01/settings"
CurrentProfile=
"(Default)"
GeneratedClassNamespace=
"软件系统客户端Wpf.Properties"
GeneratedClassName=
"Settings"
>
<Profiles
/>
<Settings>
<Setting
Name=
"设置"
Type=
"System.String"
Scope=
"User"
>
<Value
Profile=
"(Default)"
/>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
软件系统客户端Wpf/Views/PaletteSelectorViewModel.cs
浏览文件 @
c27ed928
...
...
@@ -18,7 +18,7 @@ namespace 软件系统客户端Wpf.Views
public
ICommand
ToggleBaseCommand
{
get
;
}
=
new
AnotherCommandImplementation
(
o
=>
ApplyBase
((
bool
)
o
));
p
rivate
static
void
ApplyBase
(
bool
isDark
)
p
ublic
static
void
ApplyBase
(
bool
isDark
)
{
new
PaletteHelper
().
SetLightDark
(
isDark
);
}
...
...
@@ -27,14 +27,14 @@ namespace 软件系统客户端Wpf.Views
public
ICommand
ApplyPrimaryCommand
{
get
;
}
=
new
AnotherCommandImplementation
(
o
=>
ApplyPrimary
((
Swatch
)
o
));
p
rivate
static
void
ApplyPrimary
(
Swatch
swatch
)
p
ublic
static
void
ApplyPrimary
(
Swatch
swatch
)
{
new
PaletteHelper
().
ReplacePrimaryColor
(
swatch
);
}
public
ICommand
ApplyAccentCommand
{
get
;
}
=
new
AnotherCommandImplementation
(
o
=>
ApplyAccent
((
Swatch
)
o
));
p
rivate
static
void
ApplyAccent
(
Swatch
swatch
)
p
ublic
static
void
ApplyAccent
(
Swatch
swatch
)
{
new
PaletteHelper
().
ReplaceAccentColor
(
swatch
);
}
...
...
软件系统客户端Wpf/Views/UserPaletteSelector.xaml
浏览文件 @
c27ed928
...
...
@@ -7,7 +7,7 @@
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
xmlns:local="clr-namespace:软件系统客户端Wpf.Views"
mc:Ignorable="d"
d:DesignHeight="700" d:DesignWidth="400">
d:DesignHeight="700" d:DesignWidth="400"
Loaded="UserControl_Loaded"
>
<UserControl.Resources>
<Style x:Key="MaterialDesignFloatingHintTextBox" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}" TargetType="{x:Type TextBox}">
<Setter Property="FontSize" Value="24" />
...
...
@@ -96,7 +96,8 @@
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="8">
<TextBlock VerticalAlignment="Center">浅色主题</TextBlock>
<ToggleButton Margin="8 0 16 0" Command="{Binding ToggleBaseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" />
<ToggleButton Margin="8 0 16 0" Command="{Binding ToggleBaseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}"
x:Name="CheckBox_Theme" Checked="CheckBox_Theme_Checked" Unchecked="CheckBox_Theme_Unchecked"/>
<TextBlock VerticalAlignment="Center">暗色主题</TextBlock>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0 12 0 0">
...
...
软件系统客户端Wpf/Views/UserPaletteSelector.xaml.cs
浏览文件 @
c27ed928
using
System
;
using
MaterialDesignThemes.Wpf
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -24,5 +25,22 @@ namespace 软件系统客户端Wpf.Views
{
InitializeComponent
();
}
private
void
CheckBox_Theme_Checked
(
object
sender
,
RoutedEventArgs
e
)
{
ClientsLibrary
.
UserClient
.
JsonSettings
.
IsThemeDark
=
true
;
ClientsLibrary
.
UserClient
.
JsonSettings
.
SaveToFile
();
}
private
void
CheckBox_Theme_Unchecked
(
object
sender
,
RoutedEventArgs
e
)
{
ClientsLibrary
.
UserClient
.
JsonSettings
.
IsThemeDark
=
false
;
ClientsLibrary
.
UserClient
.
JsonSettings
.
SaveToFile
();
}
private
void
UserControl_Loaded
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
ClientsLibrary
.
UserClient
.
JsonSettings
.
IsThemeDark
)
CheckBox_Theme
.
IsChecked
=
true
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录