Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Framework
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.Framework
Commits
c4d5b0a0
Commit
c4d5b0a0
authored
Oct 18, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补全缺失文件
parent
16647705
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
220 additions
and
0 deletions
+220
-0
VIZ.Framework.Common.Resource/Path/ArrowPathResource.xaml
+13
-0
VIZ.Framework.Common.Resource/Style/Button/Button_Normal.xaml
+52
-0
VIZ.Framework.Common.Resource/VIZ.Framework.Common.Resource.csproj
+8
-0
VIZ.Framework.Common/VIZ.Framework.Common.csproj
+1
-0
VIZ.Framework.Common/Widgets/FlashingBorder/FlashingBorder.cs
+146
-0
No files found.
VIZ.Framework.Common.Resource/Path/ArrowPathResource.xaml
0 → 100644
View file @
c4d5b0a0
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- 箭头路径 资源 -->
<!-- 向右箭头 -->
<Geometry x:Key="ARROW_RESOURCE_LEFT">M0,5 5,0 5,3 20,3 20,7 5,7 5,10 0,5</Geometry>
<!-- 向左箭头 -->
<Geometry x:Key="ARROW_RESOURCE_RIGHT">M0,3 15,3 15,0 20,5 15,10 15,7 0,7 0,3</Geometry>
</ResourceDictionary>
\ No newline at end of file
VIZ.Framework.Common.Resource/Style/Button/Button_Normal.xaml
0 → 100644
View file @
c4d5b0a0
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- 空样式按钮 -->
<Style x:Key="Button_None" TargetType="Button">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="BorderBrush" Value="Transparent"></Setter>
<Setter Property="BorderThickness" Value="0"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"></ContentPresenter>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 带白色背景按钮样式 -->
<Style x:Key="Button_None_WriteBackground" TargetType="Button">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="BorderBrush" Value="Transparent"></Setter>
<Setter Property="BorderThickness" Value="0"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"></ContentPresenter>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#22ffffff"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
VIZ.Framework.Common.Resource/VIZ.Framework.Common.Resource.csproj
View file @
c4d5b0a0
...
...
@@ -66,10 +66,18 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="Path\ArrowPathResource.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style\Button\Button_MessageBox.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style\Button\Button_Normal.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style\Button\Button_WindowTop.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
...
...
VIZ.Framework.Common/VIZ.Framework.Common.csproj
View file @
c4d5b0a0
...
...
@@ -299,6 +299,7 @@
</Compile>
<Compile Include="Widgets\DebugBorder\DebugBorder.cs" />
<Compile Include="Widgets\DragWindowBar\DragWindowBar.cs" />
<Compile Include="Widgets\FlashingBorder\FlashingBorder.cs" />
<Compile Include="Widgets\GPIOPinTestControl\GPIOPinTestControl.cs" />
<Compile Include="Widgets\HotkeyBox\HotkeyBox.cs" />
<Compile Include="Widgets\HotkeyBox\HotkeyHelper.cs" />
...
...
VIZ.Framework.Common/Widgets/FlashingBorder/FlashingBorder.cs
0 → 100644
View file @
c4d5b0a0
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
VIZ.Framework.Core
;
using
VIZ.Framework.Domain
;
namespace
VIZ.Framework.Common
{
/// <summary>
/// 闪烁面板
/// </summary>
public
class
FlashingBorder
:
Border
,
IDisposable
{
/// <summary>
/// 日志
/// </summary>
private
readonly
static
ILog
log
=
LogManager
.
GetLogger
(
typeof
(
FlashingBorder
));
/// <summary>
/// 时间控件
/// </summary>
public
FlashingBorder
()
{
ApplicationDomain
.
ObjectPoolManager
.
Add
(
$"FlashingBorder__
{
Guid
.
NewGuid
()}
"
,
this
);
this
.
Loaded
+=
FlashingBorder_Loaded
;
}
#
region
IsFlashingEnabled
--
是否启用闪烁
/// <summary>
/// 是否启用闪烁
/// </summary>
public
bool
IsFlashingEnabled
{
get
{
return
(
bool
)
GetValue
(
IsFlashingEnabledProperty
);
}
set
{
SetValue
(
IsFlashingEnabledProperty
,
value
);
}
}
/// <summary>
/// Using a DependencyProperty as the backing store for IsFlashingEnabled. This enables animation, styling, binding, etc...
/// </summary>
public
static
readonly
DependencyProperty
IsFlashingEnabledProperty
=
DependencyProperty
.
Register
(
"IsFlashingEnabled"
,
typeof
(
bool
),
typeof
(
FlashingBorder
),
new
PropertyMetadata
(
false
));
#
endregion
#
region
FlashingInterval
--
闪烁间隔(单位:秒)
/// <summary>
/// 闪烁间隔(单位:秒)
/// </summary>
public
TimeSpan
FlashingInterval
{
get
{
return
(
TimeSpan
)
GetValue
(
FlashingIntervalProperty
);
}
set
{
SetValue
(
FlashingIntervalProperty
,
value
);
}
}
/// <summary>
/// Using a DependencyProperty as the backing store for FlashingInterval. This enables animation, styling, binding, etc...
/// </summary>
public
static
readonly
DependencyProperty
FlashingIntervalProperty
=
DependencyProperty
.
Register
(
"FlashingInterval"
,
typeof
(
TimeSpan
),
typeof
(
FlashingBorder
),
new
PropertyMetadata
(
TimeSpan
.
Zero
));
#
endregion
/// <summary>
/// 更新任务信息
/// </summary>
private
TaskInfo
updateTaskInfo
;
/// <summary>
/// 更新任务
/// </summary>
private
Task
updateTask
;
/// <summary>
/// 销毁
/// </summary>
public
void
Dispose
()
{
if
(
this
.
updateTaskInfo
==
null
)
return
;
this
.
updateTaskInfo
.
IsCancel
=
true
;
this
.
updateTaskInfo
=
null
;
this
.
updateTask
=
null
;
}
/// <summary>
/// 控件完成加载
/// </summary>
private
void
FlashingBorder_Loaded
(
object
sender
,
System
.
Windows
.
RoutedEventArgs
e
)
{
if
(
this
.
updateTask
!=
null
||
WPFHelper
.
IsInDesignMode
(
this
))
return
;
this
.
updateTaskInfo
=
new
TaskInfo
();
this
.
updateTask
=
Task
.
Run
(
this
.
update
);
}
/// <summary>
/// 更新
/// </summary>
[
DebuggerNonUserCode
]
private
void
update
()
{
TaskInfo
info
=
this
.
updateTaskInfo
;
if
(
info
==
null
)
return
;
TimeSpan
interval
=
TimeSpan
.
FromSeconds
(
1
);
while
(!
info
.
IsCancel
)
{
WPFHelper
.
Invoke
(()
=>
{
if
(!
this
.
IsFlashingEnabled
)
{
this
.
Visibility
=
Visibility
.
Visible
;
return
;
}
this
.
Visibility
=
this
.
Visibility
==
Visibility
.
Visible
?
Visibility
.
Hidden
:
Visibility
.
Visible
;
interval
=
this
.
FlashingInterval
;
});
if
(
interval
>
TimeSpan
.
Zero
)
{
Task
.
Delay
(
interval
).
Wait
();
}
else
{
Task
.
Delay
(
1000
).
Wait
();
}
}
}
}
}
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