Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Package
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Package
Commits
e06f9c9a
Commit
e06f9c9a
authored
Mar 29, 2023
by
wangonghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改Clock的问题
parent
0f0164fc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
564 additions
and
1 deletions
+564
-1
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ColorEdit/ColorEditPanel.xaml
+162
-0
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ColorEdit/ColorEditPanel.xaml.cs
+31
-0
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ColorEdit/ColorEditPanelModel.cs
+343
-0
VIZ.Package.Module/ControlObject/FieldEdit/ViewModel/FieldEditViewModelBase.cs
+8
-0
VIZ.Package.Module/VIZ.Package.Module.csproj
+8
-0
VIZ.Package.Service/Viz/VizCommandControlObjectService.cs
+3
-0
VIZ.Package.Storage/Enum/VizControlFieldType.cs
+9
-1
No files found.
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ColorEdit/ColorEditPanel.xaml
0 → 100644
View file @
e06f9c9a
<UserControl x:Class="VIZ.Package.Module.ColorEditPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
mc:Ignorable="d"
x:Name="colorEditControl"
d:DesignHeight="300" d:DesignWidth="380">
<UserControl.Resources>
<dx:ColorToBrushConverter x:Key="ColorToBrushConverter" />
<Style x:Key="paletteColorsStyle" TargetType="ListBox">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="1,0,1,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Fill="{Binding Converter={StaticResource ColorToBrushConverter}}" Width="12" Height="12" Stroke="Gray" StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate TargetType="RadioButton" x:Key="radioToggle">
<ToggleButton Content="{TemplateBinding Content}" IsChecked="{Binding IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
</ControlTemplate>
<DataTemplate x:Key="itemTemplate">
<StackPanel Orientation="Horizontal" Margin="0,1,0,1">
<ListBox ItemsSource="{Binding Converter={StaticResource PaletteCollectionConverter}}" Margin="6,0,0,0" Style="{StaticResource paletteColorsStyle}"/>
<TextBlock Text="{Binding Name}" Margin="6,0,6,0"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="smallItemTemplate">
<StackPanel Orientation="Horizontal" Margin="0,1,0,1">
<TextBlock Text="{Binding Name}" Margin="6,0,6,0"/>
</StackPanel>
</DataTemplate>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Height="40">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<!--<ColumnDefinition Width="85"/>
<ColumnDefinition Width="85"/>
<ColumnDefinition Width="85"/>
<ColumnDefinition Width="85"/>-->
<ColumnDefinition Width="340"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<dxe:ButtonEdit ShowText="False" AllowDefaultButton="False" IsEnabled="{Binding BtnGroupEnable,Mode=TwoWay}">
<dxe:ButtonInfo Content="Ambient" IsEnabled="{Binding Path=IsEnabledA,Mode=TwoWay}" Command="{Binding AmbCommand}"/>
<dxe:ButtonInfo Content="Diffuse" IsEnabled="{Binding Path=IsEnabledD,Mode=TwoWay}" Command="{Binding DiffCommand}"/>
<dxe:ButtonInfo Content="Specular" IsEnabled="{Binding Path=IsEnabledS,Mode=TwoWay}" Command="{Binding SpecCommand}"/>
<dxe:ButtonInfo Content="Emission" IsEnabled="{Binding Path=IsEnabledE,Mode=TwoWay}" Command="{Binding EmisCommand}"/>
</dxe:ButtonEdit>
<CheckBox Content="E" Margin="10,0,0,0"
ToolTip="Title Safe"
IsChecked="{Binding Path=IsEnabledAll,Mode=TwoWay}" Grid.Column="4">
</CheckBox>
<!--<Button Content="E" Grid.Column="4" IsEnabled="{Binding Path=IsEnabledAll,Mode=TwoWay}" Command="{Binding EnableCommand}" Style="{StaticResource CheckBox_Preview_TA}"/>-->
<!--<dxe:ToggleSwitch x:Name="toggleSwitch"
VerticalAlignment="Center"
HorizontalAlignment="Center"
CheckedStateContent="E"
UncheckedStateContent="E"
ContentPlacement="Inside"
Grid.Column="4"/>-->
</Grid>
</WrapPanel>
<WrapPanel Grid.Row="1" Height="40">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<WrapPanel Grid.Column="0" Height="40">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Shininess" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<dxe:TextEdit Grid.Column="1" Text="{Binding Path=Shininess,Mode=TwoWay}" HorizontalAlignment="Left" Height="30" Width="80" VerticalAlignment="Center"/>
</Grid>
</WrapPanel>
<WrapPanel Grid.Column="1" Height="40">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Alpha" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<dxe:TextEdit Grid.Column="1" Text="{Binding Path=Alpha,Mode=TwoWay}" HorizontalAlignment="Left" Width="80" Height="30" VerticalAlignment="Center"/>
</Grid>
</WrapPanel>
<Border Name="currentColor" BorderBrush="DarkGray" BorderThickness="1" Width="40" Background="{Binding Path=ColorValue, Converter={StaticResource ColorToBrushConverter} }" Grid.Column="2"/>
</Grid>
</WrapPanel>
<StackPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<dxe:ColorEdit Color="{Binding Path=ColorValue,Mode=TwoWay}" ShowDefaultColorButton="False" >
</dxe:ColorEdit>
</StackPanel>
</Grid>
</UserControl>
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ColorEdit/ColorEditPanel.xaml.cs
0 → 100644
View file @
e06f9c9a
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
using
VIZ.Framework.Core
;
namespace
VIZ.Package.Module
{
/// <summary>
/// Interaction logic for ColorEditPanel.xaml
/// </summary>
public
partial
class
ColorEditPanel
:
UserControl
{
public
ColorEditPanel
()
{
InitializeComponent
();
//WPF的绑定
WPFHelper
.
BindingViewModel
(
this
,
new
ColorEditPanelModel
());
}
}
}
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ColorEdit/ColorEditPanelModel.cs
0 → 100644
View file @
e06f9c9a
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Media
;
using
VIZ.Framework.Core
;
namespace
VIZ.Package.Module
{
public
class
ColorEditPanelModel
:
EditPanelModelBase
{
public
override
string
GetFieldValue
()
{
throw
new
NotImplementedException
();
}
public
ColorEditPanelModel
()
{
InitCommand
();
}
/// <summary>
/// 初始化方法
/// </summary>
private
void
InitCommand
()
{
this
.
AmbCommand
=
new
VCommand
(
AmbCmd
);
this
.
DiffCommand
=
new
VCommand
(
DiffCmd
);
this
.
SpecCommand
=
new
VCommand
(
SpecCmd
);
this
.
EmisCommand
=
new
VCommand
(
EmisCmd
);
}
/// <summary>
/// 绑定color颜色
/// </summary>
private
Color
colorValue
;
public
Color
ColorValue
{
get
{
return
colorValue
;
}
set
{
colorValue
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ColorValue
));
if
(
IsEnabledAll
)
{
if
(
IsEnabledA
==
false
)
{
ambientColor
=
colorValue
;
}
else
if
(
IsEnabledD
==
false
)
{
diffuseColor
=
colorValue
;
}
else
if
(
IsEnabledS
==
false
)
{
specularColor
=
colorValue
;
}
else
if
(
IsEnabledE
==
false
)
{
emissionColor
=
colorValue
;
}
}
else
{
eColor
=
colorValue
;
}
}
}
private
Color
ambientColor
;
private
Color
diffuseColor
;
private
Color
specularColor
;
private
Color
emissionColor
;
private
Color
eColor
;
/// <summary>
/// 是否Ambient是否被禁用
/// </summary>
private
bool
isEnabledA
=
false
;
public
bool
IsEnabledA
{
get
{
return
isEnabledA
;
}
set
{
isEnabledA
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsEnabledA
));
if
(
isEnabledA
==
false
)
{
ColorValue
=
ambientColor
;
}
}
}
/// <summary>
/// Diffuse 是否禁用
/// </summary>
private
bool
isEnabledD
=
true
;
public
bool
IsEnabledD
{
get
{
return
isEnabledD
;
}
set
{
isEnabledD
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsEnabledD
));
if
(
IsEnabledD
==
false
)
{
ColorValue
=
diffuseColor
;
}
}
}
/// <summary>
/// Specular 是否被禁用
/// </summary>
private
bool
isEnabledS
=
true
;
public
bool
IsEnabledS
{
get
{
return
isEnabledS
;
}
set
{
isEnabledS
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsEnabledS
));
if
(
IsEnabledS
==
false
)
{
ColorValue
=
specularColor
;
}
}
}
/// <summary>
/// Emission 是否被禁用
/// </summary>
private
bool
isEnabledE
=
true
;
public
bool
IsEnabledE
{
get
{
return
isEnabledE
;
}
set
{
isEnabledE
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsEnabledE
));
if
(
isEnabledE
==
false
)
{
ColorValue
=
emissionColor
;
}
}
}
/// <summary>
/// E 是否禁用
/// </summary>
private
bool
isEnabledAll
=
true
;
public
bool
IsEnabledAll
{
get
{
return
isEnabledAll
;
}
set
{
isEnabledAll
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsEnabledAll
));
if
(
isEnabledAll
)
{
BtnGroupEnable
=
true
;
if
(
IsEnabledA
==
false
)
{
ColorValue
=
ambientColor
;
}
else
if
(
IsEnabledD
==
false
)
{
ColorValue
=
diffuseColor
;
}
else
if
(
IsEnabledS
==
false
)
{
ColorValue
=
specularColor
;
}
else
if
(
IsEnabledE
==
false
)
{
ColorValue
=
emissionColor
;
}
else
if
(
IsEnabledAll
==
false
)
{
ColorValue
=
eColor
;
}
}
else
{
BtnGroupEnable
=
false
;
ColorValue
=
eColor
;
}
}
}
/// <summary>
/// BtnGroupEnable 是否禁用-
///
/// </summary>
private
bool
btnGroupEnable
=
true
;
public
bool
BtnGroupEnable
{
get
{
return
btnGroupEnable
;
}
set
{
btnGroupEnable
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
BtnGroupEnable
));
}
}
/// <summary>
/// shininess类型
/// </summary>
private
double
shininess
;
public
double
Shininess
{
get
{
return
shininess
;
}
set
{
shininess
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Shininess
));
}
}
/// <summary>
/// alpha类型
/// </summary>
private
double
alpha
;
public
double
Alpha
{
get
{
return
alpha
;
}
set
{
alpha
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Alpha
));
}
}
/// <summary>
/// AmbCommand 方法
/// </summary>
public
VCommand
AmbCommand
{
get
;
set
;
}
private
void
AmbCmd
()
{
IsEnabledA
=
false
;
IsEnabledD
=
true
;
IsEnabledS
=
true
;
IsEnabledE
=
true
;
}
/// <summary>
/// DiffCommand
/// </summary>
public
VCommand
DiffCommand
{
get
;
set
;
}
private
void
DiffCmd
()
{
IsEnabledA
=
true
;
IsEnabledD
=
false
;
IsEnabledS
=
true
;
IsEnabledE
=
true
;
}
/// <summary>
/// SpecCommand 方法
/// </summary>
public
VCommand
SpecCommand
{
get
;
set
;
}
private
void
SpecCmd
()
{
IsEnabledA
=
true
;
IsEnabledD
=
true
;
IsEnabledS
=
false
;
IsEnabledE
=
true
;
}
/// <summary>
/// EmisCommand 方法
/// </summary>
public
VCommand
EmisCommand
{
get
;
set
;
}
private
void
EmisCmd
()
{
IsEnabledA
=
true
;
IsEnabledD
=
true
;
IsEnabledS
=
true
;
IsEnabledE
=
false
;
}
///// <summary>
///// EnableCommand 方法
///// </summary>
//public VCommand EnableCommand { get; set; }
//private void EnableCmd()
//{
// if (IsEnabledAll)
// {
// BtnGroupEnable = false;
// IsEnabledAll = true;
// }
// else
// {
// BtnGroupEnable = true;
// IsEnabledAll = false;
// }
//}
}
}
VIZ.Package.Module/ControlObject/FieldEdit/ViewModel/FieldEditViewModelBase.cs
View file @
e06f9c9a
...
@@ -141,6 +141,14 @@ namespace VIZ.Package.Module
...
@@ -141,6 +141,14 @@ namespace VIZ.Package.Module
ViewType
=
typeof
(
ClockEditPanel
),
ViewType
=
typeof
(
ClockEditPanel
),
ViewCreated
=
this
.
OnViewCreated
ViewCreated
=
this
.
OnViewCreated
})
;
})
;
// 颜色类型
this
.
navigationConfigs
.
Add
(
new
NavigationConfig
{
Key
=
VizControlFieldType
.
color
.
ToString
(),
ViewType
=
typeof
(
ColorEditPanel
),
ViewCreated
=
this
.
OnViewCreated
});
}
}
// =============================================================
// =============================================================
...
...
VIZ.Package.Module/VIZ.Package.Module.csproj
View file @
e06f9c9a
...
@@ -97,6 +97,10 @@
...
@@ -97,6 +97,10 @@
<DependentUpon>ClockEditPanel.xaml</DependentUpon>
<DependentUpon>ClockEditPanel.xaml</DependentUpon>
</Compile>
</Compile>
<Compile Include="ControlObject\FieldEdit\Edit\ClockEdit\ClockEditPanelModel.cs" />
<Compile Include="ControlObject\FieldEdit\Edit\ClockEdit\ClockEditPanelModel.cs" />
<Compile Include="ControlObject\FieldEdit\Edit\ColorEdit\ColorEditPanel.xaml.cs">
<DependentUpon>ColorEditPanel.xaml</DependentUpon>
</Compile>
<Compile Include="ControlObject\FieldEdit\Edit\ColorEdit\ColorEditPanelModel.cs" />
<Compile Include="ControlObject\FieldEdit\Edit\RadioEdit\RadioEditPanel.xaml.cs">
<Compile Include="ControlObject\FieldEdit\Edit\RadioEdit\RadioEditPanel.xaml.cs">
<DependentUpon>RadioEditPanel.xaml</DependentUpon>
<DependentUpon>RadioEditPanel.xaml</DependentUpon>
</Compile>
</Compile>
...
@@ -450,6 +454,10 @@
...
@@ -450,6 +454,10 @@
<SubType>Designer</SubType>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
</Page>
</Page>
<Page Include="ControlObject\FieldEdit\Edit\ColorEdit\ColorEditPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ControlObject\FieldEdit\Edit\RadioEdit\RadioEditPanel.xaml">
<Page Include="ControlObject\FieldEdit\Edit\RadioEdit\RadioEditPanel.xaml">
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<SubType>Designer</SubType>
...
...
VIZ.Package.Service/Viz/VizCommandControlObjectService.cs
View file @
e06f9c9a
...
@@ -597,6 +597,9 @@ namespace VIZ.Package.Service
...
@@ -597,6 +597,9 @@ namespace VIZ.Package.Service
if
(
type
==
"clock"
)
if
(
type
==
"clock"
)
return
VizControlFieldType
.
clock
;
return
VizControlFieldType
.
clock
;
if
(
type
==
"color"
)
return
VizControlFieldType
.
color
;
return
VizControlFieldType
.
none
;
return
VizControlFieldType
.
none
;
}
}
...
...
VIZ.Package.Storage/Enum/VizControlFieldType.cs
View file @
e06f9c9a
...
@@ -107,6 +107,14 @@ namespace VIZ.Package.Storage
...
@@ -107,6 +107,14 @@ namespace VIZ.Package.Storage
/// 时钟
/// 时钟
/// </summary>
/// </summary>
[
Description
(
"时钟"
)]
[
Description
(
"时钟"
)]
clock
clock
,
/// <summary>
/// 颜色
/// </summary>
[
Description
(
"颜色"
)]
color
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment