Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
ClientServerProject
提交
1798018e
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,发现更多精彩内容 >>
提交
1798018e
编写于
7月 16, 2017
作者:
Richard__Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增主题颜色设置,可设置浅色,暗色,已经其他色调。
上级
0eec231a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
126 addition
and
9 deletion
+126
-9
README.md
README.md
+4
-0
软件系统客户端Wpf/MainWindow.xaml
软件系统客户端Wpf/MainWindow.xaml
+13
-5
软件系统客户端Wpf/MainWindow.xaml.cs
软件系统客户端Wpf/MainWindow.xaml.cs
+1
-1
软件系统客户端Wpf/Views/AnotherCommandImplementation.cs
软件系统客户端Wpf/Views/AnotherCommandImplementation.cs
+57
-0
软件系统客户端Wpf/Views/PaletteSelectorViewModel.cs
软件系统客户端Wpf/Views/PaletteSelectorViewModel.cs
+42
-0
软件系统客户端Wpf/Views/UserPaletteSelector.xaml
软件系统客户端Wpf/Views/UserPaletteSelector.xaml
+7
-3
软件系统客户端Wpf/screenshots/client3.png
软件系统客户端Wpf/screenshots/client3.png
+0
-0
软件系统客户端Wpf/软件系统客户端Wpf.csproj
软件系统客户端Wpf/软件系统客户端Wpf.csproj
+2
-0
未找到文件。
README.md
浏览文件 @
1798018e
...
...
@@ -164,6 +164,10 @@ using HslCommunication.Profinet;
![](
https://github.com/dathlin/C-S-/raw/master/软件系统客户端Wpf/screenshots/client2.png
)
###### 主窗口的暗色主题
![](
https://github.com/dathlin/C-S-/raw/master/软件系统客户端Wpf/screenshots/client3.png
)
###### 其他功能等待添加
<br
/>
...
...
软件系统客户端Wpf/MainWindow.xaml
浏览文件 @
1798018e
...
...
@@ -8,7 +8,13 @@
xmlns:y="clr-namespace:ClientsLibrary;assembly=ClientsLibrary"
mc:Ignorable="d"
Title="MainWindow" Height="550" Width="825" WindowState="Maximized" Activated="Window_Activated" Closing="Window_Closing" ContentRendered="Window_ContentRendered" Initialized="Window_Initialized"
Loaded="Window_Loaded">
Loaded="Window_Loaded"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}">
<Window.Resources>
<ResourceDictionary>
...
...
@@ -20,6 +26,8 @@
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RadioButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignCaptionTextBlock}" x:Key="Caption">
<Setter Property="Opacity" Value=".68"></Setter>
...
...
@@ -126,7 +134,7 @@
</Menu>
<!--底部状态栏以及公告-->
<Grid DockPanel.Dock="Bottom"
Background="WhiteSmoke"
>
<Grid DockPanel.Dock="Bottom">
<Grid Margin="2">
<Grid>
<Grid.ColumnDefinitions>
...
...
@@ -140,8 +148,8 @@
<TextBlock x:Name="TextBlock_Version">1.0.0</TextBlock>
<TextBlock Margin="20,0,0,0">客户端状态:</TextBlock>
<TextBlock x:Name="TextBlock_ClientStatus">正在连接服务器...</TextBlock>
<TextBlock Margin="20,0,0,0" Foreground="Blue">温馨提示:</TextBlock>
<TextBlock x:Name="TextBlock_Information" Foreground="Blue"></TextBlock>
<TextBlock Margin="20,0,0,0" Foreground="
Dodger
Blue">温馨提示:</TextBlock>
<TextBlock x:Name="TextBlock_Information" Foreground="
Dodger
Blue"></TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal">
...
...
@@ -156,7 +164,7 @@
</Grid>
<Grid Width="100" DockPanel.Dock="Left">
<Border BorderThickness="0,1,1,1" BorderBrush="
Light
Gray" Padding="5">
<Border BorderThickness="0,1,1,1" BorderBrush="
Dark
Gray" Padding="5">
<StackPanel>
<TextBlock>随便放点什么东西</TextBlock>
<Button Style="{StaticResource MaterialDesignRaisedLightButton}" Grid.Column="1" Width="60" VerticalAlignment="Center"
...
...
软件系统客户端Wpf/MainWindow.xaml.cs
浏览文件 @
1798018e
...
...
@@ -667,7 +667,7 @@ namespace 软件系统客户端Wpf
UIControl_Home
=
new
UserHome
();
all_main_render
.
Add
(
UIControl_Home
);
UIControl_Palette
=
new
UserPaletteSelector
();
UIControl_Palette
=
new
UserPaletteSelector
()
{
DataContext
=
new
PaletteSelectorViewModel
()
}
;
all_main_render
.
Add
(
UIControl_Palette
);
...
...
软件系统客户端Wpf/Views/AnotherCommandImplementation.cs
0 → 100644
浏览文件 @
1798018e
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Input
;
namespace
软件系统客户端
Wpf.Views
{
/// <summary>
/// No WPF project is complete without it's own version of this.
/// </summary>
public
class
AnotherCommandImplementation
:
ICommand
{
private
readonly
Action
<
object
>
_execute
;
private
readonly
Func
<
object
,
bool
>
_canExecute
;
public
AnotherCommandImplementation
(
Action
<
object
>
execute
)
:
this
(
execute
,
null
)
{
}
public
AnotherCommandImplementation
(
Action
<
object
>
execute
,
Func
<
object
,
bool
>
canExecute
)
{
if
(
execute
==
null
)
throw
new
ArgumentNullException
(
nameof
(
execute
));
_execute
=
execute
;
_canExecute
=
canExecute
??
(
x
=>
true
);
}
public
bool
CanExecute
(
object
parameter
)
{
return
_canExecute
(
parameter
);
}
public
void
Execute
(
object
parameter
)
{
_execute
(
parameter
);
}
public
event
EventHandler
CanExecuteChanged
{
add
{
CommandManager
.
RequerySuggested
+=
value
;
}
remove
{
CommandManager
.
RequerySuggested
-=
value
;
}
}
public
void
Refresh
()
{
CommandManager
.
InvalidateRequerySuggested
();
}
}
}
软件系统客户端Wpf/Views/PaletteSelectorViewModel.cs
0 → 100644
浏览文件 @
1798018e
using
MaterialDesignColors
;
using
MaterialDesignThemes.Wpf
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Input
;
namespace
软件系统客户端
Wpf.Views
{
public
class
PaletteSelectorViewModel
{
public
PaletteSelectorViewModel
()
{
Swatches
=
new
SwatchesProvider
().
Swatches
;
}
public
ICommand
ToggleBaseCommand
{
get
;
}
=
new
AnotherCommandImplementation
(
o
=>
ApplyBase
((
bool
)
o
));
private
static
void
ApplyBase
(
bool
isDark
)
{
new
PaletteHelper
().
SetLightDark
(
isDark
);
}
public
IEnumerable
<
Swatch
>
Swatches
{
get
;
}
public
ICommand
ApplyPrimaryCommand
{
get
;
}
=
new
AnotherCommandImplementation
(
o
=>
ApplyPrimary
((
Swatch
)
o
));
private
static
void
ApplyPrimary
(
Swatch
swatch
)
{
new
PaletteHelper
().
ReplacePrimaryColor
(
swatch
);
}
public
ICommand
ApplyAccentCommand
{
get
;
}
=
new
AnotherCommandImplementation
(
o
=>
ApplyAccent
((
Swatch
)
o
));
private
static
void
ApplyAccent
(
Swatch
swatch
)
{
new
PaletteHelper
().
ReplaceAccentColor
(
swatch
);
}
}
}
软件系统客户端Wpf/Views/UserPaletteSelector.xaml
浏览文件 @
1798018e
...
...
@@ -9,6 +9,9 @@
mc:Ignorable="d"
d:DesignHeight="700" d:DesignWidth="400">
<UserControl.Resources>
<Style x:Key="MaterialDesignFloatingHintTextBox" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}" TargetType="{x:Type TextBox}">
<Setter Property="FontSize" Value="24" />
</Style>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
<Setter Property="Margin" Value="0" />
<Setter Property="CommandParameter" Value="{Binding}" />
...
...
@@ -82,7 +85,8 @@
<wpf:Card DockPanel.Dock="Top" Margin="2">
<DockPanel>
<local:Palette DockPanel.Dock="Left" Width="200" />
<TextBlock Margin="16" TextWrapping="Wrap" VerticalAlignment="Center">This is your current palette. Configure your initial palette in App.xaml, but palettes can be changed at runtime.</TextBlock>
<TextBlock Margin="16" TextWrapping="Wrap" VerticalAlignment="Center">这是你当前的主题配色,可以在app.xaml中进行配置和初始化,
也可以在运行的时候进行更改。</TextBlock>
</DockPanel>
</wpf:Card>
<Grid Margin="0 16 0 0">
...
...
@@ -91,9 +95,9 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="8">
<TextBlock VerticalAlignment="Center">
Light
</TextBlock>
<TextBlock VerticalAlignment="Center">
浅色主题
</TextBlock>
<ToggleButton Margin="8 0 16 0" Command="{Binding ToggleBaseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" />
<TextBlock VerticalAlignment="Center">
Dark
</TextBlock>
<TextBlock VerticalAlignment="Center">
暗色主题
</TextBlock>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0 12 0 0">
<ItemsControl ItemsSource="{Binding Swatches, Mode=OneTime}">
...
...
软件系统客户端Wpf/screenshots/client3.png
0 → 100644
浏览文件 @
1798018e
106.0 KB
软件系统客户端Wpf/软件系统客户端Wpf.csproj
浏览文件 @
1798018e
...
...
@@ -73,9 +73,11 @@
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</ApplicationDefinition>
<Compile
Include=
"Views\AnotherCommandImplementation.cs"
/>
<Compile
Include=
"Views\Palette.xaml.cs"
>
<DependentUpon>
Palette.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"Views\PaletteSelectorViewModel.cs"
/>
<Compile
Include=
"Views\UserChat.xaml.cs"
>
<DependentUpon>
UserChat.xaml
</DependentUpon>
</Compile>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录