36 files changed
+725
-243
No files matched your search
@@ -1,5 +1,42 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: TipElement 提示元素
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
# 属性
|
||||||
|
|
||||||
|
| 名称 | 用途 |
|
||||||
|
| ---------- | -------- |
|
||||||
|
| Placement | 提示元素显示位置 |
|
||||||
|
| Visibility | 是否可见 |
|
||||||
|
|
||||||
|
|
||||||
|
# 使用案例
|
||||||
|
|
||||||
|
## Placement 提示元素显示位置
|
||||||
|
|
||||||
|
该属性,用于设定提示元素显示位置,目前支持BottomRight和TopLeft(默认值)
|
||||||
|
|
||||||
|
```
|
||||||
|
<hc:RangeSlider Width="400"
|
||||||
|
hc:TipElement.Visibility="Visible"
|
||||||
|
TickPlacement="BottomRight"
|
||||||
|
IsSnapToTickEnabled="True"
|
||||||
|
Maximum="100" ValueEnd="60"
|
||||||
|
TickFrequency="10"
|
||||||
|
Margin="0,32,0,0"/>
|
||||||
|
<hc:RangeSlider Width="400"
|
||||||
|
hc:TipElement.Visibility="Visible"
|
||||||
|
hc:TipElement.Placement="BottomRight"
|
||||||
|
TickPlacement="BottomRight"
|
||||||
|
IsSnapToTickEnabled="True"
|
||||||
|
Maximum="100" ValueEnd="60"
|
||||||
|
TickFrequency="10"
|
||||||
|
Margin="0,32,0,0"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
效果
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
@@ -12,32 +12,32 @@ title: Border 边框
|
|||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<UniformGrid Margin="32,32,0,0" Columns="3" Rows="2">
|
<UniformGrid Margin="32,32,0,0" Columns="3" Rows="2">
|
||||||
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32">
|
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="0,0,32,32">
|
||||||
<Border Background="{DynamicResource PrimaryBrush}">
|
<Border Background="{DynamicResource PrimaryBrush}">
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow1}">
|
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow1}">
|
||||||
<Border Background="{DynamicResource InfoBrush}">
|
<Border Background="{DynamicResource InfoBrush}">
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow2}">
|
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow2}">
|
||||||
<Border Background="{DynamicResource WarningBrush}">
|
<Border Background="{DynamicResource WarningBrush}">
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow3}">
|
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow3}">
|
||||||
<Border Background="{DynamicResource DangerBrush}">
|
<Border Background="{DynamicResource DangerBrush}">
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow4}">
|
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow4}">
|
||||||
<Border Background="{DynamicResource AccentBrush}">
|
<Border Background="{DynamicResource AccentBrush}">
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow5}">
|
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow5}">
|
||||||
<Border Background="{DynamicResource BorderBrush}">
|
<Border Background="{DynamicResource BorderBrush}">
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
</Border>
|
</Border>
|
||||||
@@ -45,6 +45,8 @@ title: Border 边框
|
|||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
提示:新版本中使用的`BorderRegion`,有别于老版本使用样式`BorderRegionStyle`,由直角变更为圆角
|
||||||
|
|
||||||
# BorderVerticallySplitter
|
# BorderVerticallySplitter
|
||||||
|
|
||||||
此样式使用1单位宽度的Border来分割横向排列的控件。
|
此样式使用1单位宽度的Border来分割横向排列的控件。
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: Image图片
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
在`HandyControl`中,对应原生的`Image`控件,仅仅提供了一个默认的控件样式,并未提供特殊样式,对于个性化定制,需要使用者自行定制。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<StackPanel Background="LightGray">
|
||||||
|
<Image Source="Resources/Images/Image_basestyle.png" Margin="0,10"></Image>
|
||||||
|
<Image Source="Resources/Images/Image_basestyle.png" RenderOptions.BitmapScalingMode="HighQuality" Stretch="Uniform"></Image>
|
||||||
|
</StackPanel>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
@@ -1,5 +1,87 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: Lable标签
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
# LabelBaseStyle
|
||||||
|
|
||||||
|
Label标签默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Label Content="Label默认样式" Margin="10"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# LabelPrimary : LabelBaseStyle
|
||||||
|
|
||||||
|
主样式
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Label Content="LabelPrimary样式" Margin="10" Style="{DynamicResource LabelPrimary}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# LabelSuccess : LabelBaseStyle
|
||||||
|
|
||||||
|
成功类型样式
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Label Content="LabelSuccess样式" Margin="10" Style="{DynamicResource LabelSuccess}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# LabelInfo : LabelBaseStyle
|
||||||
|
|
||||||
|
信息类型样式
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Label Content="LabelInfo样式" Margin="10" Style="{DynamicResource LabelInfo}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# LabelWarning : LabelBaseStyle
|
||||||
|
|
||||||
|
警告类型样式
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Label Content="LabelWarning样式" Margin="10" Style="{DynamicResource LabelWarning}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# LabelDanger : LabelBaseStyle
|
||||||
|
|
||||||
|
危险类型样式
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Label Content="LabelDanger样式" Margin="10" Style="{DynamicResource LabelDanger}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
@@ -1,5 +1,147 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: ListBox 列表框
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
# ListBoxBaseStyle
|
||||||
|
|
||||||
|
ListBox默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Style BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox"/>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# ListBoxCustom : ListBoxBaseStyle
|
||||||
|
|
||||||
|
ListBox列表Custom样式,该样式保留了Listbox的基本属性样式,而数据显示样式由当前用户自定义,实现个性化定制。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
|
Style="{DynamicResource ListBoxCustom}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border BorderThickness="1" BorderBrush="Black" Margin="0,5">
|
||||||
|
<DockPanel LastChildFill="True">
|
||||||
|
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||||
|
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# WrapPanelHorizontalListBox : ListBoxCustom
|
||||||
|
|
||||||
|
布局容器为WrapPanel,水平方向显示样式。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
|
Style="{DynamicResource WrapPanelHorizontalListBox}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border BorderThickness="1" BorderBrush="Black" Margin="5,0">
|
||||||
|
<DockPanel LastChildFill="True">
|
||||||
|
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||||
|
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# WrapPanelVerticalListBox : ListBoxCustom
|
||||||
|
|
||||||
|
布局容器为WrapPanel,垂直方向显示样式。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
|
Style="{DynamicResource WrapPanelVerticalListBox}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border BorderThickness="1" BorderBrush="Black" Margin="0,5">
|
||||||
|
<DockPanel LastChildFill="True">
|
||||||
|
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||||
|
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# StackPanelHorizontalListBox : ListBoxCustom
|
||||||
|
|
||||||
|
布局容器为StackPanel,水平方向显示样式。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
|
Style="{DynamicResource StackPanelHorizontalListBox}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border BorderThickness="1" BorderBrush="Black" Margin="5,0">
|
||||||
|
<DockPanel LastChildFill="True">
|
||||||
|
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||||
|
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# StackPanelVerticalListBox : ListBoxCustom
|
||||||
|
|
||||||
|
布局容器为StackPanel,垂直方向显示样式。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
|
Style="{DynamicResource StackPanelVerticalListBox}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border BorderThickness="1" BorderBrush="Black" Margin="0,1">
|
||||||
|
<DockPanel LastChildFill="True">
|
||||||
|
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||||
|
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
@@ -1,5 +1,23 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: ListView 列表视图
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
`HandyControl`中仅提供了一个默认的`ListView`样式,可根据个人需求,自行定义。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<ListView ItemsSource="{Binding DataList}" Margin="20">
|
||||||
|
<ListView.View>
|
||||||
|
<GridView>
|
||||||
|
<GridViewColumn Width="80" Header="标题1" DisplayMemberBinding="{Binding Index}"/>
|
||||||
|
<GridViewColumn Width="100" Header="标题2" DisplayMemberBinding="{Binding Name}"/>
|
||||||
|
<GridViewColumn Width="200" Header="标题3" DisplayMemberBinding="{Binding Remark}"/>
|
||||||
|
</GridView>
|
||||||
|
</ListView.View>
|
||||||
|
</ListView>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
@@ -1,5 +1,23 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: Menu 菜单
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
# MenuBaseStyle
|
||||||
|
|
||||||
|
菜单默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Menu ItemsSource="{Binding Menus}">
|
||||||
|
<Menu.ItemTemplate>
|
||||||
|
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
||||||
|
<TextBlock Text="{Binding Name}"></TextBlock>
|
||||||
|
</HierarchicalDataTemplate>
|
||||||
|
</Menu.ItemTemplate>
|
||||||
|
</Menu>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
@@ -1,5 +1,45 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: PasswordBox 密码框
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
# PasswordBoxBaseStyle
|
||||||
|
|
||||||
|
原生密码框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<PasswordBox PasswordChar="*" VerticalAlignment="Center" Width="120"></PasswordBox>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# PasswordBoxExtendBaseStyle : PasswordBoxBaseStyle
|
||||||
|
|
||||||
|
原生密码框扩展默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||||
|
|
||||||
|
# PasswordBoxExtend : PasswordBoxExtendBaseStyle
|
||||||
|
|
||||||
|
相对于原生密码框默认样式,它借助于附加属性可以实现标题、水印的功能。
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<!--为使普通密码输入文本框显示水印,需要设定PasswordBoxAttach.PasswordLength="0"-->
|
||||||
|
<PasswordBox Style="{DynamicResource PasswordBoxExtend}" PasswordChar="*"
|
||||||
|
hc:PasswordBoxAttach.PasswordLength="0"
|
||||||
|
hc:InfoElement.Placeholder="请输入密码"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Width="120"></PasswordBox>
|
||||||
|
<PasswordBox Style="{DynamicResource PasswordBoxExtend}" PasswordChar="*"
|
||||||
|
hc:TitleElement.Title="用户密码:"
|
||||||
|
hc:TitleElement.TitleAlignment="Top"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Width="120"></PasswordBox>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
@@ -1,5 +1,79 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: ProgressBar 进度条
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
# ProgressBarBaseStyle
|
||||||
|
|
||||||
|
进度条默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||||
|
|
||||||
|
# 其他样式
|
||||||
|
|
||||||
|
`HandyControl`中自带的其他样式和效果,其中包含如下样式:
|
||||||
|
|
||||||
|
| 样式Key | 用途 |父样式|
|
||||||
|
| ------------------ | ---- ||
|
||||||
|
| ProgressBarSuccess | 成功色进度条 |ProgressBarBaseStyle|
|
||||||
|
| ProgressBarInfo | 提示色进度条 |ProgressBarBaseStyle|
|
||||||
|
| ProgressBarWarning | 警告色进度条 |ProgressBarBaseStyle|
|
||||||
|
| ProgressBarDanger | 危险色进度条 |ProgressBarBaseStyle|
|
||||||
|
| ProgressBarStripeBaseStyle | 条纹进度条默认样式(不推荐直接使用) |-|
|
||||||
|
| ProgressBarPrimaryStripe | 主题色条纹进度条 |ProgressBarStripeBaseStyle|
|
||||||
|
| ProgressBarSuccessStripe | 成功色条纹进度条 |ProgressBarStripeBaseStyle|
|
||||||
|
| ProgressBarInfoStripe | 信息色条纹进度条 |ProgressBarStripeBaseStyle|
|
||||||
|
| ProgressBarWarningStripe | 警告色条纹进度条 |ProgressBarStripeBaseStyle|
|
||||||
|
| ProgressBarDangerStripe | 危险色条纹进度条 |ProgressBarStripeBaseStyle|
|
||||||
|
| ProgressBarFlat | 扁平风格 |-|
|
||||||
|
|
||||||
|
案例:
|
||||||
|
```xml
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="默认样式"></TextBlock>
|
||||||
|
<ProgressBar Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarSuccess"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarSuccess}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarInfo"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarInfo}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarWarning"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarWarning}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarDanger"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarDanger}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarPrimaryStripe"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarPrimaryStripe}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarSuccessStripe"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarSuccessStripe}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarInfoStripe"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarInfoStripe}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarWarningStripe"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarWarningStripe}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarDangerStripe"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarDangerStripe}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="20">
|
||||||
|
<TextBlock Text="ProgressBarFlat"></TextBlock>
|
||||||
|
<ProgressBar Style="{DynamicResource ProgressBarFlat}" Value="40"></ProgressBar>
|
||||||
|
</StackPanel>
|
||||||
|
```
|
||||||
|
效果:
|
||||||
|

|
||||||
|
|
||||||
|
# 温馨提示
|
||||||
|
|
||||||
|
对于颜色、圆角或其它自定义需求,可参考[进度条样式源码](https://github.com/HandyOrg/HandyControl/blob/master/src/Shared/HandyControl_Shared/Themes/Styles/ProgressBar.xaml)自行定义。
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||||
<Setter Property="controls:ScrollViewer.IsEnableInertia" Value="False"/>
|
<Setter Property="controls:ScrollViewer.IsInertiaEnabled" Value="False"/>
|
||||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
<Setter Property="VirtualizingPanel.IsVirtualizing" Value="True"/>
|
<Setter Property="VirtualizingPanel.IsVirtualizing" Value="True"/>
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="TreeView">
|
<ControlTemplate TargetType="TreeView">
|
||||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
||||||
<controls:ScrollViewer x:Name="_tv_scrollviewer_" IsEnableInertia="{Binding Path=(controls:ScrollViewer.IsEnableInertia),RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ScrollViewerBaseControlTemplate}" Background="{TemplateBinding Background}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
<controls:ScrollViewer x:Name="_tv_scrollviewer_" IsInertiaEnabled="{Binding Path=(controls:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ScrollViewerBaseControlTemplate}" Background="{TemplateBinding Background}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||||
<ItemsPresenter/>
|
<ItemsPresenter/>
|
||||||
</controls:ScrollViewer>
|
</controls:ScrollViewer>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -103,14 +103,14 @@
|
|||||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||||
<Setter Property="controls:ScrollViewer.IsEnableInertia" Value="False"/>
|
<Setter Property="controls:ScrollViewer.IsInertiaEnabled" Value="False"/>
|
||||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="TreeView">
|
<ControlTemplate TargetType="TreeView">
|
||||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
||||||
<controls:ScrollViewer x:Name="_tv_scrollviewer_" IsEnableInertia="{Binding Path=(controls:ScrollViewer.IsEnableInertia),RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ScrollViewerBaseControlTemplate}" Background="{TemplateBinding Background}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
<controls:ScrollViewer x:Name="_tv_scrollviewer_" IsInertiaEnabled="{Binding Path=(controls:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ScrollViewerBaseControlTemplate}" Background="{TemplateBinding Background}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||||
<ItemsPresenter/>
|
<ItemsPresenter/>
|
||||||
</controls:ScrollViewer>
|
</controls:ScrollViewer>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||||
<Setter Property="controls:ScrollViewer.IsEnableInertia" Value="False"/>
|
<Setter Property="controls:ScrollViewer.IsInertiaEnabled" Value="False"/>
|
||||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
<Setter Property="VirtualizingPanel.IsVirtualizing" Value="True"/>
|
<Setter Property="VirtualizingPanel.IsVirtualizing" Value="True"/>
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="TreeView">
|
<ControlTemplate TargetType="TreeView">
|
||||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
||||||
<controls:ScrollViewer x:Name="_tv_scrollviewer_" IsEnableInertia="{Binding Path=(controls:ScrollViewer.IsEnableInertia),RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ScrollViewerBaseControlTemplate}" Background="{TemplateBinding Background}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
<controls:ScrollViewer x:Name="_tv_scrollviewer_" IsInertiaEnabled="{Binding Path=(controls:ScrollViewer.IsInertiaEnabled),RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ScrollViewerBaseControlTemplate}" Background="{TemplateBinding Background}" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||||
<ItemsPresenter/>
|
<ItemsPresenter/>
|
||||||
</controls:ScrollViewer>
|
</controls:ScrollViewer>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<userControl:LeftMainContent/>
|
<userControl:LeftMainContent/>
|
||||||
<userControl:MainContent Grid.Column="1"/>
|
<userControl:MainContent Grid.Column="1"/>
|
||||||
<GridSplitter Grid.Column="1" HorizontalAlignment="Left" Width="4" Background="Transparent" BorderThickness="1,0,0,0" BorderBrush="{DynamicResource BorderBrush}"/>
|
<GridSplitter Grid.Column="1" HorizontalAlignment="Left" Width="4" Background="Transparent" BorderThickness="1,0,0,0" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||||
<hc:ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Right" IsEnableInertia="True" IsPenetrating="True">
|
<hc:ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Right" IsInertiaEnabled="True" IsPenetrating="True">
|
||||||
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,10"/>
|
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,10"/>
|
||||||
</hc:ScrollViewer>
|
</hc:ScrollViewer>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
Background="{DynamicResource RegionBrush}">
|
Background="{DynamicResource RegionBrush}">
|
||||||
<hc:TransitioningContentControl>
|
<hc:TransitioningContentControl>
|
||||||
<hc:SimplePanel Width="500" Height="400">
|
<hc:SimplePanel Width="500" Height="400">
|
||||||
<hc:ScrollViewer Name="ScrollViewerDemo" IsEnableInertia="True" Margin="0,10,0,0">
|
<hc:ScrollViewer Name="ScrollViewerDemo" IsInertiaEnabled="True" Margin="0,10,0,0">
|
||||||
<Border Height="2000" Margin="8,0">
|
<Border Height="2000" Margin="8,0">
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
<hc:OutlineText Margin="0,10,0,0" FontSize="30" FontStyle="Italic" Text="{Binding Source={x:Static langs:Lang.Text}, Converter={StaticResource StringRepeatConverter}, ConverterParameter=8}"/>
|
<hc:OutlineText Margin="0,10,0,0" FontSize="30" FontStyle="Italic" Text="{Binding Source={x:Static langs:Lang.Text}, Converter={StaticResource StringRepeatConverter}, ConverterParameter=8}"/>
|
||||||
<hc:OutlineText Margin="0,10,0,0" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" FontSize="50" StrokeThickness="2" Fill="{DynamicResource DangerBrush}" Stroke="{DynamicResource PrimaryBrush}" Text="{Binding Source={x:Static langs:Lang.Text}, Converter={StaticResource StringRepeatConverter}, ConverterParameter=5}"/>
|
<hc:OutlineText Margin="0,10,0,0" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" FontSize="50" StrokeThickness="2" Fill="{DynamicResource DangerBrush}" Stroke="{DynamicResource PrimaryBrush}" Text="{Binding Source={x:Static langs:Lang.Text}, Converter={StaticResource StringRepeatConverter}, ConverterParameter=5}"/>
|
||||||
<hc:OutlineText Margin="0,10,0,0" FontSize="80" FontWeight="Bold" StrokeThickness="4" Fill="{DynamicResource PrimaryBrush}" Stroke="{DynamicResource DangerBrush}" Text="{Binding Source={x:Static langs:Lang.Text}, Converter={StaticResource StringRepeatConverter}, ConverterParameter=2}"/>
|
<hc:OutlineText Margin="0,10,0,0" FontSize="80" FontWeight="Bold" StrokeThickness="4" Fill="{DynamicResource PrimaryBrush}" Stroke="{DynamicResource DangerBrush}" Text="{Binding Source={x:Static langs:Lang.Text}, Converter={StaticResource StringRepeatConverter}, ConverterParameter=2}"/>
|
||||||
|
<hc:OutlineText Margin="0,10,0,0" StrokePosition="Outside" FontSize="80" FontWeight="Bold" StrokeThickness="4" Fill="{DynamicResource PrimaryBrush}" Stroke="{DynamicResource DangerBrush}" Text="{Binding Source={x:Static langs:Lang.Text}, Converter={StaticResource StringRepeatConverter}, ConverterParameter=2}"/>
|
||||||
|
<hc:OutlineText Margin="0,10,0,0" StrokePosition="InSide" FontSize="80" FontWeight="Bold" StrokeThickness="4" Fill="{DynamicResource PrimaryBrush}" Stroke="{DynamicResource DangerBrush}" Text="{Binding Source={x:Static langs:Lang.Text}, Converter={StaticResource StringRepeatConverter}, ConverterParameter=2}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</hc:TransitioningContentControl>
|
</hc:TransitioningContentControl>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Border BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
<Border BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
|
||||||
<hc:ScrollViewer Orientation="Horizontal" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" IsEnableInertia="True">
|
<hc:ScrollViewer Orientation="Horizontal" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" IsInertiaEnabled="True">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="10,10,32,10">
|
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="10,10,32,10">
|
||||||
<Border Background="{DynamicResource PrimaryBrush}">
|
<Border Background="{DynamicResource PrimaryBrush}">
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
</hc:ScrollViewer>
|
</hc:ScrollViewer>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Grid.Row="1" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Margin="0,16,0,0">
|
<Border Grid.Row="1" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Margin="0,16,0,0">
|
||||||
<hc:ScrollViewer IsEnableInertia="True">
|
<hc:ScrollViewer IsInertiaEnabled="True">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="10,10,32,10">
|
<Border Style="{StaticResource BorderRegion}" Width="200" Height="200" Margin="10,10,32,10">
|
||||||
<Border Background="{DynamicResource PrimaryBrush}">
|
<Border Background="{DynamicResource PrimaryBrush}">
|
||||||
|
|||||||
@@ -40,22 +40,22 @@
|
|||||||
</hc:TabItem>
|
</hc:TabItem>
|
||||||
</hc:TabControl>
|
</hc:TabControl>
|
||||||
<StackPanel Orientation="Horizontal" Margin="32,32,32,16">
|
<StackPanel Orientation="Horizontal" Margin="32,32,32,16">
|
||||||
<Label Style="{StaticResource LabelPrimary}" Margin="0" Content="IsEnableTabFill = True"/>
|
<Label Style="{StaticResource LabelPrimary}" Margin="0" Content="IsTabFillEnabled = True"/>
|
||||||
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="ShowCloseButton = True"/>
|
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="ShowCloseButton = True"/>
|
||||||
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="IsDraggable = True"/>
|
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="IsDraggable = True"/>
|
||||||
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="IsEnableAnimation = True"/>
|
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="IsAnimationEnabled = True"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<hc:TabControl x:Name="TabControlDemo" IsEnableAnimation="True" ShowCloseButton="True" IsDraggable="True" IsEnableTabFill="True" Margin="32,0,32,32" Width="800" Height="300">
|
<hc:TabControl x:Name="TabControlDemo" IsAnimationEnabled="True" ShowCloseButton="True" IsDraggable="True" IsTabFillEnabled="True" Margin="32,0,32,32" Width="800" Height="300">
|
||||||
<hc:TabItem Header="TabItem1">
|
<hc:TabItem Header="TabItem1" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource ConfigGeometry}">
|
||||||
<hc:SimplePanel Background="{DynamicResource RegionBrush}"/>
|
<hc:SimplePanel Background="{DynamicResource RegionBrush}"/>
|
||||||
</hc:TabItem>
|
</hc:TabItem>
|
||||||
<hc:TabItem IsSelected="True" Header="TabItem2">
|
<hc:TabItem IsSelected="True" Header="TabItem2" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CalendarGeometry}">
|
||||||
<hc:SimplePanel Tag="123" Background="#FFE8563F"/>
|
<hc:SimplePanel Tag="123" Background="#FFE8563F"/>
|
||||||
</hc:TabItem>
|
</hc:TabItem>
|
||||||
<hc:TabItem Header="TabItem3">
|
<hc:TabItem Header="TabItem3" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource WindowsGeometry}">
|
||||||
<hc:SimplePanel Background="#FF3F4EE8"/>
|
<hc:SimplePanel Background="#FF3F4EE8"/>
|
||||||
</hc:TabItem>
|
</hc:TabItem>
|
||||||
<hc:TabItem Header="TabItem4">
|
<hc:TabItem Header="TabItem4" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource ClockGeometry}">
|
||||||
<hc:SimplePanel Background="#FFE83F6D"/>
|
<hc:SimplePanel Background="#FFE83F6D"/>
|
||||||
</hc:TabItem>
|
</hc:TabItem>
|
||||||
<hc:TabItem Header="TabItem5">
|
<hc:TabItem Header="TabItem5">
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<hc:SimplePanel Background="#FFE8E03F"/>
|
<hc:SimplePanel Background="#FFE8E03F"/>
|
||||||
</hc:TabItem>
|
</hc:TabItem>
|
||||||
</hc:TabControl>
|
</hc:TabControl>
|
||||||
<hc:TabControl IsEnableAnimation="True" ShowCloseButton="True" IsDraggable="True" ItemsSource="{Binding DataList}" Width="800" Height="300">
|
<hc:TabControl IsAnimationEnabled="True" ShowCloseButton="True" IsDraggable="True" ItemsSource="{Binding DataList}" Width="800" Height="300">
|
||||||
<TabControl.ItemTemplate>
|
<TabControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Header}"/>
|
<TextBlock Text="{Binding Header}"/>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<Border hc:ScrollViewer.IsEnableInertia="True"
|
<Border hc:ScrollViewer.IsInertiaEnabled="True"
|
||||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||||
xmlns:command="http://www.galasoft.ch/mvvmlight"
|
xmlns:command="http://www.galasoft.ch/mvvmlight"
|
||||||
x:Class="HandyControlDemo.UserControl.LeftMainContent"
|
x:Class="HandyControlDemo.UserControl.LeftMainContent"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||||
Background="{DynamicResource RegionBrush}">
|
Background="{DynamicResource RegionBrush}">
|
||||||
<hc:TransitioningContentControl>
|
<hc:TransitioningContentControl>
|
||||||
<hc:ScrollViewer IsEnableInertia="True">
|
<hc:ScrollViewer IsInertiaEnabled="True">
|
||||||
<StackPanel Margin="32">
|
<StackPanel Margin="32">
|
||||||
<WrapPanel ItemWidth="160" ItemHeight="130">
|
<WrapPanel ItemWidth="160" ItemHeight="130">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||||
Background="{DynamicResource RegionBrush}">
|
Background="{DynamicResource RegionBrush}">
|
||||||
<hc:TransitioningContentControl>
|
<hc:TransitioningContentControl>
|
||||||
<hc:ScrollViewer IsEnableInertia="True">
|
<hc:ScrollViewer IsInertiaEnabled="True">
|
||||||
<StackPanel Margin="32">
|
<StackPanel Margin="32">
|
||||||
<WrapPanel ItemWidth="160" ItemHeight="130">
|
<WrapPanel ItemWidth="160" ItemHeight="130">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||||
<hc:TransitioningContentControl>
|
<hc:TransitioningContentControl>
|
||||||
<hc:ScrollViewer IsEnableInertia="True">
|
<hc:ScrollViewer IsInertiaEnabled="True">
|
||||||
<StackPanel Margin="32">
|
<StackPanel Margin="32">
|
||||||
<WrapPanel ItemWidth="160" ItemHeight="130">
|
<WrapPanel ItemWidth="160" ItemHeight="130">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<Button Command="{Binding FatalCmd}" Content="{x:Static langs:Lang.Fatal}" Margin="5,0"/>
|
<Button Command="{Binding FatalCmd}" Content="{x:Static langs:Lang.Fatal}" Margin="5,0"/>
|
||||||
<Button Command="{Binding ClearCmd}" Content="{x:Static langs:Lang.Clear}" Margin="5,0,0,0" Style="{StaticResource ButtonPrimary}"/>
|
<Button Command="{Binding ClearCmd}" Content="{x:Static langs:Lang.Clear}" Margin="5,0,0,0" Style="{StaticResource ButtonPrimary}"/>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
<hc:ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Right" IsEnableInertia="True" IsPenetrating="True">
|
<hc:ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Right" IsInertiaEnabled="True" IsPenetrating="True">
|
||||||
<StackPanel hc:Growl.Token="{x:Static data:MessageToken.GrowlDemoPanel}" VerticalAlignment="Top" Margin="0,10,10,10"/>
|
<StackPanel hc:Growl.Token="{x:Static data:MessageToken.GrowlDemoPanel}" VerticalAlignment="Top" Margin="0,10,10,10"/>
|
||||||
</hc:ScrollViewer>
|
</hc:ScrollViewer>
|
||||||
</hc:SimplePanel>
|
</hc:SimplePanel>
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
_tickCount++;
|
_tickCount++;
|
||||||
if (_tickCount >= _waitTime) Close();
|
if (_tickCount >= _waitTime) Close(true);
|
||||||
};
|
};
|
||||||
_timerClose.Start();
|
_timerClose.Start();
|
||||||
}
|
}
|
||||||
@@ -462,6 +462,96 @@ namespace HandyControl.Controls
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void InitGrowlInfo(ref GrowlInfo growlInfo, InfoType infoType)
|
||||||
|
{
|
||||||
|
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
||||||
|
growlInfo.Type = infoType;
|
||||||
|
|
||||||
|
switch (infoType)
|
||||||
|
{
|
||||||
|
case InfoType.Success:
|
||||||
|
if (!growlInfo.IsCustom)
|
||||||
|
{
|
||||||
|
growlInfo.IconKey = ResourceToken.SuccessGeometry;
|
||||||
|
growlInfo.IconBrushKey = ResourceToken.SuccessBrush;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
growlInfo.IconKey ??= ResourceToken.SuccessGeometry;
|
||||||
|
growlInfo.IconBrushKey ??= ResourceToken.SuccessBrush;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case InfoType.Info:
|
||||||
|
if (!growlInfo.IsCustom)
|
||||||
|
{
|
||||||
|
growlInfo.IconKey = ResourceToken.InfoGeometry;
|
||||||
|
growlInfo.IconBrushKey = ResourceToken.InfoBrush;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
growlInfo.IconKey ??= ResourceToken.InfoGeometry;
|
||||||
|
growlInfo.IconBrushKey ??= ResourceToken.InfoBrush;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case InfoType.Warning:
|
||||||
|
if (!growlInfo.IsCustom)
|
||||||
|
{
|
||||||
|
growlInfo.IconKey = ResourceToken.WarningGeometry;
|
||||||
|
growlInfo.IconBrushKey = ResourceToken.WarningBrush;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
growlInfo.IconKey ??= ResourceToken.WarningGeometry;
|
||||||
|
growlInfo.IconBrushKey ??= ResourceToken.WarningBrush;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case InfoType.Error:
|
||||||
|
if (!growlInfo.IsCustom)
|
||||||
|
{
|
||||||
|
growlInfo.IconKey = ResourceToken.ErrorGeometry;
|
||||||
|
growlInfo.IconBrushKey = ResourceToken.DangerBrush;
|
||||||
|
growlInfo.StaysOpen = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
growlInfo.IconKey ??= ResourceToken.ErrorGeometry;
|
||||||
|
growlInfo.IconBrushKey ??= ResourceToken.DangerBrush;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case InfoType.Fatal:
|
||||||
|
if (!growlInfo.IsCustom)
|
||||||
|
{
|
||||||
|
growlInfo.IconKey = ResourceToken.FatalGeometry;
|
||||||
|
growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush;
|
||||||
|
growlInfo.StaysOpen = true;
|
||||||
|
growlInfo.ShowCloseButton = false;
|
||||||
|
if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
growlInfo.IconKey ??= ResourceToken.FatalGeometry;
|
||||||
|
growlInfo.IconBrushKey ??= ResourceToken.PrimaryTextBrush;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case InfoType.Ask:
|
||||||
|
if (!growlInfo.IsCustom)
|
||||||
|
{
|
||||||
|
growlInfo.IconKey = ResourceToken.AskGeometry;
|
||||||
|
growlInfo.IconBrushKey = ResourceToken.AccentBrush;
|
||||||
|
growlInfo.StaysOpen = true;
|
||||||
|
growlInfo.ShowCloseButton = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
growlInfo.IconKey ??= ResourceToken.AskGeometry;
|
||||||
|
growlInfo.IconBrushKey ??= ResourceToken.AccentBrush;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(infoType), infoType, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成功
|
/// 成功
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -479,13 +569,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void Success(GrowlInfo growlInfo)
|
public static void Success(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Success);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.SuccessGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.SuccessBrush;
|
|
||||||
growlInfo.Type = InfoType.Success;
|
|
||||||
}
|
|
||||||
Show(growlInfo);
|
Show(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,13 +588,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void SuccessGlobal(GrowlInfo growlInfo)
|
public static void SuccessGlobal(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Success);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.SuccessGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.SuccessBrush;
|
|
||||||
growlInfo.Type = InfoType.Success;
|
|
||||||
}
|
|
||||||
ShowGlobal(growlInfo);
|
ShowGlobal(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,13 +609,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void Info(GrowlInfo growlInfo)
|
public static void Info(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Info);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.InfoGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.InfoBrush;
|
|
||||||
growlInfo.Type = InfoType.Info;
|
|
||||||
}
|
|
||||||
Show(growlInfo);
|
Show(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,13 +628,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void InfoGlobal(GrowlInfo growlInfo)
|
public static void InfoGlobal(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Info);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.InfoGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.InfoBrush;
|
|
||||||
growlInfo.Type = InfoType.Info;
|
|
||||||
}
|
|
||||||
ShowGlobal(growlInfo);
|
ShowGlobal(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,13 +649,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void Warning(GrowlInfo growlInfo)
|
public static void Warning(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Warning);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.WarningGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.WarningBrush;
|
|
||||||
growlInfo.Type = InfoType.Warning;
|
|
||||||
}
|
|
||||||
Show(growlInfo);
|
Show(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,13 +668,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void WarningGlobal(GrowlInfo growlInfo)
|
public static void WarningGlobal(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Warning);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.WarningGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.WarningBrush;
|
|
||||||
growlInfo.Type = InfoType.Warning;
|
|
||||||
}
|
|
||||||
ShowGlobal(growlInfo);
|
ShowGlobal(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -635,14 +689,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void Error(GrowlInfo growlInfo)
|
public static void Error(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Error);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.ErrorGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.DangerBrush;
|
|
||||||
growlInfo.StaysOpen = true;
|
|
||||||
growlInfo.Type = InfoType.Error;
|
|
||||||
}
|
|
||||||
Show(growlInfo);
|
Show(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -661,14 +708,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void ErrorGlobal(GrowlInfo growlInfo)
|
public static void ErrorGlobal(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Error);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.ErrorGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.DangerBrush;
|
|
||||||
growlInfo.StaysOpen = true;
|
|
||||||
growlInfo.Type = InfoType.Error;
|
|
||||||
}
|
|
||||||
ShowGlobal(growlInfo);
|
ShowGlobal(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -689,16 +729,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void Fatal(GrowlInfo growlInfo)
|
public static void Fatal(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Fatal);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.FatalGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush;
|
|
||||||
growlInfo.StaysOpen = true;
|
|
||||||
growlInfo.ShowCloseButton = false;
|
|
||||||
growlInfo.Type = InfoType.Fatal;
|
|
||||||
if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0;
|
|
||||||
}
|
|
||||||
Show(growlInfo);
|
Show(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -717,16 +748,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void FatalGlobal(GrowlInfo growlInfo)
|
public static void FatalGlobal(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Fatal);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.FatalGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.PrimaryTextBrush;
|
|
||||||
growlInfo.StaysOpen = true;
|
|
||||||
growlInfo.ShowCloseButton = false;
|
|
||||||
growlInfo.Type = InfoType.Fatal;
|
|
||||||
if (GrowlPanel.ContextMenu != null) GrowlPanel.ContextMenu.Opacity = 0;
|
|
||||||
}
|
|
||||||
ShowGlobal(growlInfo);
|
ShowGlobal(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -749,15 +771,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void Ask(GrowlInfo growlInfo)
|
public static void Ask(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Ask);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.AskGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.AccentBrush;
|
|
||||||
growlInfo.StaysOpen = true;
|
|
||||||
growlInfo.ShowCloseButton = false;
|
|
||||||
growlInfo.Type = InfoType.Ask;
|
|
||||||
}
|
|
||||||
Show(growlInfo);
|
Show(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -778,15 +792,7 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
public static void AskGlobal(GrowlInfo growlInfo)
|
public static void AskGlobal(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
if (growlInfo == null) throw new ArgumentNullException(nameof(growlInfo));
|
InitGrowlInfo(ref growlInfo, InfoType.Ask);
|
||||||
if (!growlInfo.IsCustom)
|
|
||||||
{
|
|
||||||
growlInfo.IconKey = ResourceToken.AskGeometry;
|
|
||||||
growlInfo.IconBrushKey = ResourceToken.AccentBrush;
|
|
||||||
growlInfo.StaysOpen = true;
|
|
||||||
growlInfo.ShowCloseButton = false;
|
|
||||||
growlInfo.Type = InfoType.Ask;
|
|
||||||
}
|
|
||||||
ShowGlobal(growlInfo);
|
ShowGlobal(growlInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -795,8 +801,13 @@ namespace HandyControl.Controls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关闭
|
/// 关闭
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void Close()
|
private void Close(bool invokeActionBeforeClose = false, bool invokeParam = true)
|
||||||
{
|
{
|
||||||
|
if (invokeActionBeforeClose)
|
||||||
|
{
|
||||||
|
ActionBeforeClose?.Invoke(invokeParam);
|
||||||
|
}
|
||||||
|
|
||||||
_timerClose?.Stop();
|
_timerClose?.Stop();
|
||||||
var transform = new TranslateTransform();
|
var transform = new TranslateTransform();
|
||||||
_gridMain.RenderTransform = transform;
|
_gridMain.RenderTransform = transform;
|
||||||
@@ -862,20 +873,8 @@ namespace HandyControl.Controls
|
|||||||
GrowlWindow = null;
|
GrowlWindow = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonCancel_OnClick(object sender, RoutedEventArgs e)
|
private void ButtonCancel_OnClick(object sender, RoutedEventArgs e) => Close(true, false);
|
||||||
{
|
|
||||||
if (ActionBeforeClose?.Invoke(false) == true)
|
|
||||||
{
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonOk_OnClick(object sender, RoutedEventArgs e)
|
private void ButtonOk_OnClick(object sender, RoutedEventArgs e) => Close(true);
|
||||||
{
|
|
||||||
if (ActionBeforeClose?.Invoke(true) == true)
|
|
||||||
{
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ namespace HandyControl.Controls
|
|||||||
Content = new ScrollViewer
|
Content = new ScrollViewer
|
||||||
{
|
{
|
||||||
VerticalScrollBarVisibility = ScrollBarVisibility.Hidden,
|
VerticalScrollBarVisibility = ScrollBarVisibility.Hidden,
|
||||||
IsEnableInertia = true,
|
IsInertiaEnabled = true,
|
||||||
Content = GrowlPanel
|
Content = GrowlPanel
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,36 +25,29 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
private TextBox _textBox;
|
private TextBox _textBox;
|
||||||
|
|
||||||
|
private bool _updateText;
|
||||||
|
|
||||||
#endregion Data
|
#endregion Data
|
||||||
|
|
||||||
public NumericUpDown()
|
public NumericUpDown()
|
||||||
{
|
{
|
||||||
CommandBindings.Add(new CommandBinding(ControlCommands.Prev, (s, e) =>
|
CommandBindings.Add(new CommandBinding(ControlCommands.Prev, (s, e) =>
|
||||||
{
|
{
|
||||||
if (IsReadOnly)
|
if (IsReadOnly) return;
|
||||||
return;
|
|
||||||
|
|
||||||
Value += Increment;
|
Value += Increment;
|
||||||
_textBox.Text = CurrentText;
|
|
||||||
_textBox.Select(_textBox.Text.Length, 0);
|
|
||||||
}));
|
}));
|
||||||
CommandBindings.Add(new CommandBinding(ControlCommands.Next, (s, e) =>
|
CommandBindings.Add(new CommandBinding(ControlCommands.Next, (s, e) =>
|
||||||
{
|
{
|
||||||
if (IsReadOnly)
|
if (IsReadOnly) return;
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
Value -= Increment;
|
Value -= Increment;
|
||||||
_textBox.Text = CurrentText;
|
|
||||||
_textBox.Select(_textBox.Text.Length, 0);
|
|
||||||
}));
|
}));
|
||||||
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) =>
|
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) =>
|
||||||
{
|
{
|
||||||
if (IsReadOnly)
|
if (IsReadOnly) return;
|
||||||
return;
|
|
||||||
|
|
||||||
SetCurrentValue(ValueProperty, ValueBoxes.Double0Box);
|
SetCurrentValue(ValueProperty, ValueBoxes.Double0Box);
|
||||||
_textBox.Text = string.Empty;
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Loaded += (s, e) => OnApplyTemplate();
|
Loaded += (s, e) => OnApplyTemplate();
|
||||||
@@ -102,7 +95,9 @@ namespace HandyControl.Controls
|
|||||||
if (!VerifyData()) return;
|
if (!VerifyData()) return;
|
||||||
if (double.TryParse(_textBox.Text, out var value))
|
if (double.TryParse(_textBox.Text, out var value))
|
||||||
{
|
{
|
||||||
|
_updateText = false;
|
||||||
Value = value;
|
Value = value;
|
||||||
|
_updateText = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,18 +111,15 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (IsReadOnly)
|
if (IsReadOnly) return;
|
||||||
return;
|
|
||||||
|
|
||||||
if (e.Key == Key.Up)
|
if (e.Key == Key.Up)
|
||||||
{
|
{
|
||||||
Value += Increment;
|
Value += Increment;
|
||||||
_textBox.Text = CurrentText;
|
|
||||||
}
|
}
|
||||||
else if (e.Key == Key.Down)
|
else if (e.Key == Key.Down)
|
||||||
{
|
{
|
||||||
Value -= Increment;
|
Value -= Increment;
|
||||||
_textBox.Text = CurrentText;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,11 +127,9 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
base.OnMouseWheel(e);
|
base.OnMouseWheel(e);
|
||||||
|
|
||||||
if (_textBox.IsFocused&&IsReadOnly==false)
|
if (_textBox.IsFocused && !IsReadOnly)
|
||||||
{
|
{
|
||||||
Value += e.Delta > 0 ? Increment : -Increment;
|
Value += e.Delta > 0 ? Increment : -Increment;
|
||||||
_textBox.Text = CurrentText;
|
|
||||||
_textBox.Select(_textBox.Text.Length, 0);
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,9 +168,10 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
var ctl = (NumericUpDown) d;
|
var ctl = (NumericUpDown) d;
|
||||||
var v = (double) e.NewValue;
|
var v = (double) e.NewValue;
|
||||||
if (ctl._textBox != null)
|
if (ctl._updateText && ctl._textBox != null)
|
||||||
{
|
{
|
||||||
ctl._textBox.Text = v.ToString();
|
ctl._textBox.Text = ctl.CurrentText;
|
||||||
|
ctl._textBox.Select(ctl._textBox.Text.Length, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctl.OnValueChanged(new FunctionEventArgs<double>(ValueChangedEvent, ctl)
|
ctl.OnValueChanged(new FunctionEventArgs<double>(ValueChangedEvent, ctl)
|
||||||
@@ -375,22 +366,21 @@ namespace HandyControl.Controls
|
|||||||
set => SetValue(ShowClearButtonProperty, value);
|
set => SetValue(ShowClearButtonProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标识 IsReadOnly 依赖属性。
|
||||||
|
/// </summary>
|
||||||
|
public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
|
||||||
|
"IsReadOnly", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置一个值,该值指示NumericUpDown是否只读。
|
/// 获取或设置一个值,该值指示NumericUpDown是否只读。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsReadOnly
|
public bool IsReadOnly
|
||||||
{
|
{
|
||||||
get => (bool)GetValue(IsReadOnlyProperty);
|
get => (bool) GetValue(IsReadOnlyProperty);
|
||||||
set => SetValue(IsReadOnlyProperty, value);
|
set => SetValue(IsReadOnlyProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 标识 IsReadOnly 依赖属性。
|
|
||||||
/// </summary>
|
|
||||||
public static readonly DependencyProperty IsReadOnlyProperty =
|
|
||||||
DependencyProperty.Register(nameof(IsReadOnly), typeof(bool), typeof(NumericUpDown), new PropertyMetadata(default(bool)));
|
|
||||||
|
|
||||||
|
|
||||||
public Func<string, OperationResult<bool>> VerifyFunc { get; set; }
|
public Func<string, OperationResult<bool>> VerifyFunc { get; set; }
|
||||||
|
|
||||||
public virtual bool VerifyData()
|
public virtual bool VerifyData()
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
_scrollViewer.ScrollChanged += ScrollViewer_ScrollChanged;
|
_scrollViewer.ScrollChanged += ScrollViewer_ScrollChanged;
|
||||||
|
|
||||||
if (_scrollViewer is ScrollViewer scrollViewerHandy && Animated && scrollViewerHandy.IsEnableInertia)
|
if (_scrollViewer is ScrollViewer scrollViewerHandy && Animated && scrollViewerHandy.IsInertiaEnabled)
|
||||||
{
|
{
|
||||||
_gotoTopAction = () => scrollViewerHandy.ScrollToTopInternal(AnimationTime);
|
_gotoTopAction = () => scrollViewerHandy.ScrollToTopInternal(AnimationTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
if (!CanMouseWheel) return;
|
if (!CanMouseWheel) return;
|
||||||
|
|
||||||
if (!IsEnableInertia)
|
if (!IsInertiaEnabled)
|
||||||
{
|
{
|
||||||
if (Orientation == Orientation.Vertical)
|
if (Orientation == Orientation.Vertical)
|
||||||
{
|
{
|
||||||
@@ -142,26 +142,26 @@ namespace HandyControl.Controls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否支持惯性
|
/// 是否支持惯性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsEnableInertiaProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty IsInertiaEnabledProperty = DependencyProperty.RegisterAttached(
|
||||||
"IsEnableInertia", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.FalseBox));
|
"IsInertiaEnabled", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public static void SetIsEnableInertia(DependencyObject element, bool value)
|
public static void SetIsInertiaEnabled(DependencyObject element, bool value)
|
||||||
{
|
{
|
||||||
element.SetValue(IsEnableInertiaProperty, value);
|
element.SetValue(IsInertiaEnabledProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool GetIsEnableInertia(DependencyObject element)
|
public static bool GetIsInertiaEnabled(DependencyObject element)
|
||||||
{
|
{
|
||||||
return (bool)element.GetValue(IsEnableInertiaProperty);
|
return (bool)element.GetValue(IsInertiaEnabledProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否支持惯性
|
/// 是否支持惯性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsEnableInertia
|
public bool IsInertiaEnabled
|
||||||
{
|
{
|
||||||
get => (bool) GetValue(IsEnableInertiaProperty);
|
get => (bool) GetValue(IsInertiaEnabledProperty);
|
||||||
set => SetValue(IsEnableInertiaProperty, value);
|
set => SetValue(IsInertiaEnabledProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -50,16 +50,16 @@ namespace HandyControl.Controls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用动画
|
/// 是否启用动画
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsEnableAnimationProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsAnimationEnabledProperty = DependencyProperty.Register(
|
||||||
"IsEnableAnimation", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
|
"IsAnimationEnabled", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用动画
|
/// 是否启用动画
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsEnableAnimation
|
public bool IsAnimationEnabled
|
||||||
{
|
{
|
||||||
get => (bool)GetValue(IsEnableAnimationProperty);
|
get => (bool)GetValue(IsAnimationEnabledProperty);
|
||||||
set => SetValue(IsEnableAnimationProperty, value);
|
set => SetValue(IsAnimationEnabledProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -122,16 +122,16 @@ namespace HandyControl.Controls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否将标签填充
|
/// 是否将标签填充
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsEnableTabFillProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsTabFillEnabledProperty = DependencyProperty.Register(
|
||||||
"IsEnableTabFill", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
|
"IsTabFillEnabled", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否将标签填充
|
/// 是否将标签填充
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsEnableTabFill
|
public bool IsTabFillEnabled
|
||||||
{
|
{
|
||||||
get => (bool)GetValue(IsEnableTabFillProperty);
|
get => (bool)GetValue(IsTabFillEnabledProperty);
|
||||||
set => SetValue(IsEnableTabFillProperty, value);
|
set => SetValue(IsTabFillEnabledProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -224,7 +224,7 @@ namespace HandyControl.Controls
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsEnableTabFill)
|
if (!IsTabFillEnabled)
|
||||||
{
|
{
|
||||||
_itemShowCount = (int)(ActualWidth / TabItemWidth);
|
_itemShowCount = (int)(ActualWidth / TabItemWidth);
|
||||||
_buttonOverflow?.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount);
|
_buttonOverflow?.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount);
|
||||||
@@ -236,7 +236,7 @@ namespace HandyControl.Controls
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsEnableAnimation)
|
if (IsAnimationEnabled)
|
||||||
{
|
{
|
||||||
HeaderPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, new Duration(TimeSpan.FromMilliseconds(200)));
|
HeaderPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, new Duration(TimeSpan.FromMilliseconds(200)));
|
||||||
}
|
}
|
||||||
@@ -279,7 +279,7 @@ namespace HandyControl.Controls
|
|||||||
base.OnApplyTemplate();
|
base.OnApplyTemplate();
|
||||||
HeaderPanel = GetTemplateChild(HeaderPanelKey) as TabPanel;
|
HeaderPanel = GetTemplateChild(HeaderPanelKey) as TabPanel;
|
||||||
|
|
||||||
if (IsEnableTabFill) return;
|
if (IsTabFillEnabled) return;
|
||||||
|
|
||||||
_buttonOverflow = GetTemplateChild(OverflowButtonKey) as ContextMenuToggleButton;
|
_buttonOverflow = GetTemplateChild(OverflowButtonKey) as ContextMenuToggleButton;
|
||||||
_scrollViewerOverflow = GetTemplateChild(OverflowScrollviewer) as ScrollViewer;
|
_scrollViewerOverflow = GetTemplateChild(OverflowScrollviewer) as ScrollViewer;
|
||||||
@@ -357,7 +357,7 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
list.Remove(actualItem);
|
list.Remove(actualItem);
|
||||||
list.Insert(0, actualItem);
|
list.Insert(0, actualItem);
|
||||||
if (IsEnableAnimation)
|
if (IsAnimationEnabled)
|
||||||
{
|
{
|
||||||
HeaderPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, new Duration(TimeSpan.FromMilliseconds(200)));
|
HeaderPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, new Duration(TimeSpan.FromMilliseconds(200)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ namespace HandyControl.Controls
|
|||||||
RaiseEvent(argsClosing);
|
RaiseEvent(argsClosing);
|
||||||
if (argsClosing.Cancel) return;
|
if (argsClosing.Cancel) return;
|
||||||
|
|
||||||
TabPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, parent.IsEnableAnimation
|
TabPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, parent.IsAnimationEnabled
|
||||||
? new Duration(TimeSpan.FromMilliseconds(200))
|
? new Duration(TimeSpan.FromMilliseconds(200))
|
||||||
: new Duration(TimeSpan.FromMilliseconds(1)));
|
: new Duration(TimeSpan.FromMilliseconds(1)));
|
||||||
|
|
||||||
@@ -419,7 +419,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
TargetOffsetX = resultX;
|
TargetOffsetX = resultX;
|
||||||
if (!parent.IsEnableAnimation)
|
if (!parent.IsAnimationEnabled)
|
||||||
{
|
{
|
||||||
AnimationCompleted();
|
AnimationCompleted();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -40,16 +40,16 @@ namespace HandyControl.Controls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否将标签填充
|
/// 是否将标签填充
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsEnableTabFillProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsTabFillEnabledProperty = DependencyProperty.Register(
|
||||||
"IsEnableTabFill", typeof(bool), typeof(TabPanel), new PropertyMetadata(ValueBoxes.FalseBox));
|
"IsTabFillEnabled", typeof(bool), typeof(TabPanel), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否将标签填充
|
/// 是否将标签填充
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsEnableTabFill
|
public bool IsTabFillEnabled
|
||||||
{
|
{
|
||||||
get => (bool)GetValue(IsEnableTabFillProperty);
|
get => (bool)GetValue(IsTabFillEnabledProperty);
|
||||||
set => SetValue(IsEnableTabFillProperty, value);
|
set => SetValue(IsTabFillEnabledProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -115,7 +115,7 @@ namespace HandyControl.Controls
|
|||||||
var itemWidth = .0;
|
var itemWidth = .0;
|
||||||
var arr = new int[count];
|
var arr = new int[count];
|
||||||
|
|
||||||
if (!IsEnableTabFill)
|
if (!IsTabFillEnabled)
|
||||||
{
|
{
|
||||||
itemWidth = TabItemWidth;
|
itemWidth = TabItemWidth;
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
for (var index = 0; index < count; index++)
|
for (var index = 0; index < count; index++)
|
||||||
{
|
{
|
||||||
if (IsEnableTabFill)
|
if (IsTabFillEnabled)
|
||||||
{
|
{
|
||||||
itemWidth = arr[index];
|
itemWidth = arr[index];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,16 +10,29 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
public class OutlineText : FrameworkElement
|
public class OutlineText : FrameworkElement
|
||||||
{
|
{
|
||||||
|
private Pen _pen;
|
||||||
|
|
||||||
private FormattedText _formattedText;
|
private FormattedText _formattedText;
|
||||||
|
|
||||||
private Geometry _textGeometry;
|
private Geometry _textGeometry;
|
||||||
|
|
||||||
|
private PathGeometry _clipGeometry;
|
||||||
|
|
||||||
static OutlineText()
|
static OutlineText()
|
||||||
{
|
{
|
||||||
SnapsToDevicePixelsProperty.OverrideMetadata(typeof(OutlineText), new FrameworkPropertyMetadata(ValueBoxes.TrueBox));
|
SnapsToDevicePixelsProperty.OverrideMetadata(typeof(OutlineText), new FrameworkPropertyMetadata(ValueBoxes.TrueBox));
|
||||||
UseLayoutRoundingProperty.OverrideMetadata(typeof(OutlineText), new FrameworkPropertyMetadata(ValueBoxes.TrueBox));
|
UseLayoutRoundingProperty.OverrideMetadata(typeof(OutlineText), new FrameworkPropertyMetadata(ValueBoxes.TrueBox));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty StrokePositionProperty = DependencyProperty.Register(
|
||||||
|
"StrokePosition", typeof(StrokePosition), typeof(OutlineText), new PropertyMetadata(default(StrokePosition)));
|
||||||
|
|
||||||
|
public StrokePosition StrokePosition
|
||||||
|
{
|
||||||
|
get => (StrokePosition) GetValue(StrokePositionProperty);
|
||||||
|
set => SetValue(StrokePositionProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
|
||||||
"Text", typeof(string), typeof(OutlineText), new FrameworkPropertyMetadata(
|
"Text", typeof(string), typeof(OutlineText), new FrameworkPropertyMetadata(
|
||||||
string.Empty,
|
string.Empty,
|
||||||
@@ -143,7 +156,34 @@ namespace HandyControl.Controls
|
|||||||
protected override void OnRender(DrawingContext drawingContext)
|
protected override void OnRender(DrawingContext drawingContext)
|
||||||
{
|
{
|
||||||
EnsureGeometry();
|
EnsureGeometry();
|
||||||
drawingContext.DrawGeometry(Fill, new Pen(Stroke, StrokeThickness), _textGeometry);
|
|
||||||
|
drawingContext.DrawGeometry(Fill, null, _textGeometry);
|
||||||
|
|
||||||
|
if (StrokePosition == StrokePosition.Outside)
|
||||||
|
{
|
||||||
|
drawingContext.PushClip(_clipGeometry);
|
||||||
|
}
|
||||||
|
else if (StrokePosition == StrokePosition.Inside)
|
||||||
|
{
|
||||||
|
drawingContext.PushClip(_textGeometry);
|
||||||
|
}
|
||||||
|
|
||||||
|
drawingContext.DrawGeometry(null, _pen, _textGeometry);
|
||||||
|
|
||||||
|
if (StrokePosition == StrokePosition.Outside || StrokePosition == StrokePosition.Inside)
|
||||||
|
{
|
||||||
|
drawingContext.Pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdatePen()
|
||||||
|
{
|
||||||
|
_pen = new Pen(Stroke, StrokeThickness);
|
||||||
|
|
||||||
|
if (StrokePosition == StrokePosition.Outside || StrokePosition == StrokePosition.Inside)
|
||||||
|
{
|
||||||
|
_pen.Thickness = StrokeThickness * 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnsureFormattedText()
|
private void EnsureFormattedText()
|
||||||
@@ -187,6 +227,12 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
EnsureFormattedText();
|
EnsureFormattedText();
|
||||||
_textGeometry = _formattedText.BuildGeometry(new Point(0, 0));
|
_textGeometry = _formattedText.BuildGeometry(new Point(0, 0));
|
||||||
|
|
||||||
|
if (StrokePosition == StrokePosition.Outside)
|
||||||
|
{
|
||||||
|
var geometry = new RectangleGeometry(new Rect(0, 0, ActualWidth, ActualHeight));
|
||||||
|
_clipGeometry = Geometry.Combine(geometry, _textGeometry, GeometryCombineMode.Exclude, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateFormattedText()
|
private void UpdateFormattedText()
|
||||||
@@ -237,6 +283,8 @@ namespace HandyControl.Controls
|
|||||||
_formattedText.MaxTextWidth = Math.Min(3579139, availableSize.Width);
|
_formattedText.MaxTextWidth = Math.Min(3579139, availableSize.Width);
|
||||||
_formattedText.MaxTextHeight = Math.Max(0.0001d, availableSize.Height);
|
_formattedText.MaxTextHeight = Math.Max(0.0001d, availableSize.Height);
|
||||||
|
|
||||||
|
UpdatePen();
|
||||||
|
|
||||||
// return the desired size
|
// return the desired size
|
||||||
return new Size(_formattedText.Width, _formattedText.Height);
|
return new Size(_formattedText.Width, _formattedText.Height);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace HandyControl.Data
|
||||||
|
{
|
||||||
|
public enum StrokePosition
|
||||||
|
{
|
||||||
|
Center,
|
||||||
|
Outside,
|
||||||
|
Inside
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\HitMode.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\HitMode.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\ShowAnimation.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\ShowAnimation.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\NotifyIconInfoType.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\NotifyIconInfoType.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\StrokePosition.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\TransitionMode.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\TransitionMode.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\Commands\CloseWindowCommand.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\Commands\CloseWindowCommand.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\Commands\OpenLinkCommand.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\Commands\OpenLinkCommand.cs" />
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<Setter Property="VerticalAlignment" Value="Top"/>
|
<Setter Property="VerticalAlignment" Value="Top"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="Offset" Value="6"/>
|
<Setter Property="Offset" Value="6"/>
|
||||||
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||||
<Setter Property="controls:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
|
<Setter Property="controls:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
|
||||||
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
<RowDefinition MinHeight="{Binding Path=(controls:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(controls:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
<RowDefinition MinHeight="{Binding Path=(controls:InfoElement.MinContentHeight),RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=(controls:InfoElement.ContentHeight),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Double2GridLengthConverter}}"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Visibility="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
<StackPanel Visibility="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||||
<TextBlock Foreground="{DynamicResource PrimaryTextBrush}" Margin="1,0,0,0" Text="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(controls:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(controls:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(controls:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(controls:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border x:Name="border" Grid.Row="1" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
<Border x:Name="border" Grid.Row="1" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel Visibility="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
<StackPanel Visibility="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||||
<TextBlock Foreground="{DynamicResource PrimaryTextBrush}" Text="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
<TextBlock Text="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(controls:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(controls:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(controls:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(controls:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border x:Name="border" Grid.Column="1" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
<Border x:Name="border" Grid.Column="1" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Row="1"/>
|
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Row="1"/>
|
||||||
<StackPanel Grid.Row="0" Visibility="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
<StackPanel Grid.Row="0" Visibility="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" Margin="{TemplateBinding Padding}">
|
||||||
<TextBlock Foreground="{DynamicResource PrimaryTextBrush}" Margin="1,0,0,0" Text="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
<TextBlock Margin="1,0,0,0" Text="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(controls:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(controls:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(controls:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(controls:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
<Border Grid.Row="1" x:Name="templateRoot" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
||||||
@@ -217,7 +217,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||||
<StackPanel Grid.Column="0" Visibility="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
<StackPanel Grid.Column="0" Visibility="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0,7,6,7">
|
||||||
<TextBlock Foreground="{DynamicResource PrimaryTextBrush}" Text="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
<TextBlock Text="{Binding Path=(controls:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||||
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(controls:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(controls:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
<ContentPresenter TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(controls:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(controls:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
<Border Grid.Column="1" x:Name="templateRoot" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<Setter Property="BorderThickness" Value="1,0,1,1"/>
|
<Setter Property="BorderThickness" Value="1,0,1,1"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||||
<Setter Property="Margin" Value="0"/>
|
<Setter Property="Margin" Value="0"/>
|
||||||
<Setter Property="Padding" Value="16,0"/>
|
<Setter Property="Padding" Value="10,0,0,0"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||||
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
||||||
<Setter Property="Menu" Value="{StaticResource TabItemMenu}"/>
|
<Setter Property="Menu" Value="{StaticResource TabItemMenu}"/>
|
||||||
@@ -43,28 +43,35 @@
|
|||||||
<ControlTemplate TargetType="controls:TabItem">
|
<ControlTemplate TargetType="controls:TabItem">
|
||||||
<Grid x:Name="templateRoot" SnapsToDevicePixels="true" ContextMenu="{TemplateBinding Menu}">
|
<Grid x:Name="templateRoot" SnapsToDevicePixels="true" ContextMenu="{TemplateBinding Menu}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Border Grid.ColumnSpan="2" BorderThickness="{TemplateBinding BorderThickness}" x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="0">
|
<Border Grid.ColumnSpan="3" BorderThickness="{TemplateBinding BorderThickness}" x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="0">
|
||||||
<Border Margin="0,0,0,-1" x:Name="innerBorder" Background="{DynamicResource RegionBrush}" Opacity="0"/>
|
<Border Margin="0,0,0,-1" x:Name="innerBorder" Background="{DynamicResource RegionBrush}" Visibility="Collapsed"/>
|
||||||
</Border>
|
</Border>
|
||||||
<ContentPresenter Grid.Column="0" x:Name="contentPresenter" ContentSource="Header" Focusable="False" HorizontalAlignment="Stretch" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center">
|
<Path x:Name="PathMain" Margin="10,0,0,0" Grid.Column="0" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}"/>
|
||||||
<ContentPresenter.OpacityMask>
|
<ContentPresenter Grid.Column="1" x:Name="contentPresenter" ContentSource="Header" Focusable="False" HorizontalAlignment="Stretch" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
|
||||||
|
<Border Name="BorderMask" Grid.Column="1" HorizontalAlignment="Right" Width="20" Background="{TemplateBinding Background}">
|
||||||
|
<Border.OpacityMask>
|
||||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||||
<GradientStop Offset="1"/>
|
<GradientStop Color="White" Offset="1"/>
|
||||||
<GradientStop Color="White" Offset="0.8"/>
|
<GradientStop Offset="0"/>
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</ContentPresenter.OpacityMask>
|
</Border.OpacityMask>
|
||||||
</ContentPresenter>
|
</Border>
|
||||||
<Button Grid.Column="1" Focusable="False" Command="interactivity:ControlCommands.Close" Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Background="Transparent" Style="{StaticResource ButtonCustom}" Width="28">
|
<Button Grid.Column="2" Focusable="False" Command="interactivity:ControlCommands.Close" Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Background="Transparent" Style="{StaticResource ButtonCustom}" Width="28">
|
||||||
<Path Fill="{DynamicResource PrimaryTextBrush}" Width="8" Height="8" Style="{StaticResource ClosePathStyle}"/>
|
<Path Fill="{DynamicResource PrimaryTextBrush}" Width="8" Height="8" Style="{StaticResource ClosePathStyle}"/>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsSelected" Value="true">
|
<Trigger Property="IsSelected" Value="true">
|
||||||
<Setter Property="Panel.ZIndex" Value="1"/>
|
<Setter Property="Panel.ZIndex" Value="1"/>
|
||||||
<Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
|
<Setter Property="Visibility" TargetName="innerBorder" Value="Visible"/>
|
||||||
|
<Setter Property="Background" TargetName="BorderMask" Value="{DynamicResource RegionBrush}"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="controls:IconElement.Geometry" Value="{x:Null}">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed" TargetName="PathMain"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
@@ -84,7 +91,7 @@
|
|||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Border Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}">
|
<Border Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||||
<controls:TabPanel MinHeight="{TemplateBinding TabItemHeight}" TabItemHeight="{TemplateBinding TabItemHeight}" TabItemWidth="{TemplateBinding TabItemWidth}" IsEnableTabFill="{TemplateBinding IsEnableTabFill}" Margin="0,0,-1,-1" x:Name="PART_HeaderPanel" HorizontalAlignment="Left" Background="{DynamicResource SecondaryTextBrush}" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1">
|
<controls:TabPanel MinHeight="{TemplateBinding TabItemHeight}" TabItemHeight="{TemplateBinding TabItemHeight}" TabItemWidth="{TemplateBinding TabItemWidth}" IsTabFillEnabled="{TemplateBinding IsTabFillEnabled}" Margin="0,0,-1,-1" x:Name="PART_HeaderPanel" HorizontalAlignment="Left" Background="{DynamicResource SecondaryTextBrush}" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<interactivity:FluidMoveBehavior AppliesTo="Children" Duration="{Binding FluidMoveDuration,ElementName=PART_HeaderPanel}">
|
<interactivity:FluidMoveBehavior AppliesTo="Children" Duration="{Binding FluidMoveDuration,ElementName=PART_HeaderPanel}">
|
||||||
<interactivity:FluidMoveBehavior.EaseX>
|
<interactivity:FluidMoveBehavior.EaseX>
|
||||||
@@ -122,9 +129,9 @@
|
|||||||
</Border.CacheMode>
|
</Border.CacheMode>
|
||||||
<RepeatButton Focusable="False" Style="{StaticResource RepeatButtonIcon}" Padding="8" controls:IconElement.Geometry="{StaticResource LeftGeometry}" Foreground="{DynamicResource PrimaryTextBrush}" Background="{DynamicResource SecondaryRegionBrush}" x:Name="PART_ScrollButtonLeft"/>
|
<RepeatButton Focusable="False" Style="{StaticResource RepeatButtonIcon}" Padding="8" controls:IconElement.Geometry="{StaticResource LeftGeometry}" Foreground="{DynamicResource PrimaryTextBrush}" Background="{DynamicResource SecondaryRegionBrush}" x:Name="PART_ScrollButtonLeft"/>
|
||||||
</Border>
|
</Border>
|
||||||
<controls:ScrollViewer HorizontalScrollBarVisibility="Hidden" CanMouseWheel="True" Orientation="Horizontal" IsEnableInertia="True" Grid.Row="0" Grid.Column="1" IsDeferredScrollingEnabled="True" x:Name="PART_OverflowScrollviewer">
|
<controls:ScrollViewer HorizontalScrollBarVisibility="Hidden" CanMouseWheel="True" Orientation="Horizontal" IsInertiaEnabled="True" Grid.Row="0" Grid.Column="1" IsDeferredScrollingEnabled="True" x:Name="PART_OverflowScrollviewer">
|
||||||
<Border Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Name="PART_HeaderBorder">
|
<Border Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Name="PART_HeaderBorder">
|
||||||
<controls:TabPanel MinHeight="{TemplateBinding TabItemHeight}" TabItemHeight="{TemplateBinding TabItemHeight}" TabItemWidth="{TemplateBinding TabItemWidth}" IsEnableTabFill="{TemplateBinding IsEnableTabFill}" Margin="0,0,-1,-1" x:Name="PART_HeaderPanel" HorizontalAlignment="Left" Background="{DynamicResource SecondaryTextBrush}" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1">
|
<controls:TabPanel MinHeight="{TemplateBinding TabItemHeight}" TabItemHeight="{TemplateBinding TabItemHeight}" TabItemWidth="{TemplateBinding TabItemWidth}" IsTabFillEnabled="{TemplateBinding IsTabFillEnabled}" Margin="0,0,-1,-1" x:Name="PART_HeaderPanel" HorizontalAlignment="Left" Background="{DynamicResource SecondaryTextBrush}" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<interactivity:FluidMoveBehavior AppliesTo="Children" Duration="{Binding FluidMoveDuration,ElementName=PART_HeaderPanel}">
|
<interactivity:FluidMoveBehavior AppliesTo="Children" Duration="{Binding FluidMoveDuration,ElementName=PART_HeaderPanel}">
|
||||||
<interactivity:FluidMoveBehavior.EaseX>
|
<interactivity:FluidMoveBehavior.EaseX>
|
||||||
@@ -164,7 +171,7 @@
|
|||||||
<MultiTrigger>
|
<MultiTrigger>
|
||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsScrollable" Value="True"/>
|
<Condition Property="IsScrollable" Value="True"/>
|
||||||
<Condition Property="IsEnableTabFill" Value="False"/>
|
<Condition Property="IsTabFillEnabled" Value="False"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Template" Value="{StaticResource TabControlPlusScrollableTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource TabControlPlusScrollableTemplate}"/>
|
||||||
</MultiTrigger>
|
</MultiTrigger>
|
||||||
@@ -335,4 +342,4 @@
|
|||||||
<Setter Property="controls:TitleElement.Foreground" Value="{DynamicResource TextIconBrush}"/>
|
<Setter Property="controls:TitleElement.Foreground" Value="{DynamicResource TextIconBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
Reference in new issue
Block a user