Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
HandyControl
提交
62454537
H
HandyControl
项目概览
jobily
/
HandyControl
10 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
HandyControl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
62454537
编写于
4月 06, 2023
作者:
N
NaBian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enhance: close #1355
上级
61a964f9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
6 deletion
+20
-6
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
+3
-2
src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs
src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs
+11
-0
src/Shared/HandyControl_Shared/Themes/Styles/Base/TagBaseStyle.xaml
.../HandyControl_Shared/Themes/Styles/Base/TagBaseStyle.xaml
+3
-2
src/Shared/HandyControl_Shared/Themes/Theme.xaml
src/Shared/HandyControl_Shared/Themes/Theme.xaml
+3
-2
未找到文件。
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
浏览文件 @
62454537
...
...
@@ -5057,6 +5057,7 @@
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="hc:TitleElement.Foreground" Value="{DynamicResource TextIconBrush}" />
<Setter Property="ShowCloseButton" Value="{Binding Path=(hc:TagContainer.ShowCloseButton), RelativeSource={RelativeSource AncestorType=hc:TagContainer}}" />
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
...
...
@@ -5084,13 +5085,13 @@
<ContentPresenter TextElement.Foreground="{Binding Path=(hc:TitleElement.Foreground),RelativeSource={RelativeSource TemplatedParent}}" ContentSource="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<ContentPresenter Margin="{TemplateBinding Padding}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Button Focusable="False" Name="ButtonClose"
Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Command="interactivity:ControlCommands.Close" Margin="0,0,6,0" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}" Padding="0,11
" hc:IconElement.Geometry="{StaticResource DeleteGeometry}" Foreground="{TemplateBinding Foreground}" />
<Button Focusable="False" Name="ButtonClose"
Padding="0" BorderThickness="0" hc:IconElement.Width="8" Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Command="interactivity:ControlCommands.Close" Margin="0,0,6,0" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}
" hc:IconElement.Geometry="{StaticResource DeleteGeometry}" Foreground="{TemplateBinding Foreground}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
<Setter Property="hc:IconElement.Geometry" Value="{StaticResource DeleteFillCircleGeometry}" TargetName="ButtonClose" />
<Setter Property="
Padding" Value="0,6
" TargetName="ButtonClose" />
<Setter Property="
hc:IconElement.Width" Value="14
" TargetName="ButtonClose" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
...
...
src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs
浏览文件 @
62454537
using
System.Collections
;
using
System.Windows
;
using
System.Windows.Controls
;
using
HandyControl.Data
;
using
HandyControl.Tools.Extension
;
namespace
HandyControl.Controls
;
public
class
TagContainer
:
ItemsControl
{
public
static
readonly
DependencyProperty
ShowCloseButtonProperty
=
DependencyProperty
.
RegisterAttached
(
"ShowCloseButton"
,
typeof
(
bool
),
typeof
(
TagContainer
),
new
FrameworkPropertyMetadata
(
ValueBoxes
.
TrueBox
,
FrameworkPropertyMetadataOptions
.
Inherits
));
public
TagContainer
()
{
AddHandler
(
Controls
.
Tag
.
ClosedEvent
,
new
RoutedEventHandler
(
Tag_OnClosed
));
}
public
static
void
SetShowCloseButton
(
DependencyObject
element
,
bool
value
)
=>
element
.
SetValue
(
ShowCloseButtonProperty
,
ValueBoxes
.
BooleanBox
(
value
));
public
static
bool
GetShowCloseButton
(
DependencyObject
element
)
=>
(
bool
)
element
.
GetValue
(
ShowCloseButtonProperty
);
private
void
Tag_OnClosed
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
e
.
OriginalSource
is
Tag
tag
)
...
...
src/Shared/HandyControl_Shared/Themes/Styles/Base/TagBaseStyle.xaml
浏览文件 @
62454537
...
...
@@ -13,6 +13,7 @@
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}"/>
<Setter Property="hc:TitleElement.Foreground" Value="{DynamicResource TextIconBrush}"/>
<Setter Property="ShowCloseButton" Value="{Binding Path=(hc:TagContainer.ShowCloseButton), RelativeSource={RelativeSource AncestorType=hc:TagContainer}}" />
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
...
...
@@ -40,13 +41,13 @@
<ContentPresenter TextElement.Foreground="{Binding Path=(hc:TitleElement.Foreground),RelativeSource={RelativeSource TemplatedParent}}" ContentSource="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<ContentPresenter Margin="{TemplateBinding Padding}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Button Focusable="False" Name="ButtonClose"
Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Command="interactivity:ControlCommands.Close" Margin="0,0,6,0" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}" Padding="0,11
" hc:IconElement.Geometry="{StaticResource DeleteGeometry}" Foreground="{TemplateBinding Foreground}"/>
<Button Focusable="False" Name="ButtonClose"
Padding="0" BorderThickness="0" hc:IconElement.Width="8" Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Command="interactivity:ControlCommands.Close" Margin="0,0,6,0" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}
" hc:IconElement.Geometry="{StaticResource DeleteGeometry}" Foreground="{TemplateBinding Foreground}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
<Setter Property="hc:IconElement.Geometry" Value="{StaticResource DeleteFillCircleGeometry}" TargetName="ButtonClose"/>
<Setter Property="
Padding" Value="0,6
" TargetName="ButtonClose"/>
<Setter Property="
hc:IconElement.Width" Value="14
" TargetName="ButtonClose"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
...
...
src/Shared/HandyControl_Shared/Themes/Theme.xaml
浏览文件 @
62454537
...
...
@@ -5057,6 +5057,7 @@
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="hc:TitleElement.Foreground" Value="{DynamicResource TextIconBrush}" />
<Setter Property="ShowCloseButton" Value="{Binding Path=(hc:TagContainer.ShowCloseButton), RelativeSource={RelativeSource AncestorType=hc:TagContainer}}" />
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
...
...
@@ -5084,13 +5085,13 @@
<ContentPresenter TextElement.Foreground="{Binding Path=(hc:TitleElement.Foreground),RelativeSource={RelativeSource TemplatedParent}}" ContentSource="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<ContentPresenter Margin="{TemplateBinding Padding}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Button Focusable="False" Name="ButtonClose"
Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Command="interactivity:ControlCommands.Close" Margin="0,0,6,0" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}" Padding="0,11
" hc:IconElement.Geometry="{StaticResource DeleteGeometry}" Foreground="{TemplateBinding Foreground}" />
<Button Focusable="False" Name="ButtonClose"
Padding="0" BorderThickness="0" hc:IconElement.Width="8" Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Command="interactivity:ControlCommands.Close" Margin="0,0,6,0" Width="16" Grid.Column="2" Style="{StaticResource ButtonIcon}
" hc:IconElement.Geometry="{StaticResource DeleteGeometry}" Foreground="{TemplateBinding Foreground}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
<Setter Property="hc:IconElement.Geometry" Value="{StaticResource DeleteFillCircleGeometry}" TargetName="ButtonClose" />
<Setter Property="
Padding" Value="0,6
" TargetName="ButtonClose" />
<Setter Property="
hc:IconElement.Width" Value="14
" TargetName="ButtonClose" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录