feat: add avalonia HyperlinkButton style.
This commit is contained in:
1 parent
0c10c8234b
commit
78e729fdc5
24 files changed
+337
-50
No files matched your search
@@ -9,6 +9,7 @@
|
||||
[ "RepeatButton", "RepeatButtonDemo", "Brush.RepeatButton", "", "" ],
|
||||
[ "ToggleButton", "ToggleButtonDemo", "Brush.Toggle", "", "" ],
|
||||
[ "RadioButton", "RadioButtonDemo", "Brush.RadioButton", "", "" ],
|
||||
[ "HyperlinkButton", "HyperlinkButtonDemo", "Brush.Hyperlink", "", "" ],
|
||||
[ "CheckBox", "CheckBoxDemo", "Brush.CheckBoxChecked", "", "" ],
|
||||
[ "ScrollViewer", "NativeScrollViewerDemo", "Brush.ScrollBox", "", "" ],
|
||||
[ "Slider", "SliderDemo", "Brush.Slider", "", "" ],
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -108,9 +107,9 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 自动补全文本框.
|
||||
/// </summary>
|
||||
public static string AutoCompleteTextBox {
|
||||
public static string AutoCompleteBox {
|
||||
get {
|
||||
return ResourceManager.GetString("AutoCompleteTextBox", resourceCulture);
|
||||
return ResourceManager.GetString("AutoCompleteBox", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -915,6 +914,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 超链接按钮.
|
||||
/// </summary>
|
||||
public static string HyperlinkButton {
|
||||
get {
|
||||
return ResourceManager.GetString("HyperlinkButton", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 忽略.
|
||||
/// </summary>
|
||||
@@ -1089,7 +1097,7 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 变形动画.
|
||||
/// </summary>
|
||||
public static string Morphing_Animation {
|
||||
public static string MorphingAnimation {
|
||||
get {
|
||||
return ResourceManager.GetString("MorphingAnimation", resourceCulture);
|
||||
}
|
||||
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,7 +132,7 @@
|
||||
<data name="Ask" xml:space="preserve">
|
||||
<value>询问</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>自动补全文本框</value>
|
||||
</data>
|
||||
<data name="Badge" xml:space="preserve">
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="Window" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>超链接按钮</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -798,8 +798,8 @@
|
||||
<data name="ElementGroup" xml:space="preserve">
|
||||
<value>ElementGroup</value>
|
||||
</data>
|
||||
<data name="AutoCompleteTextBox" xml:space="preserve">
|
||||
<value>AutoCompleteTextBox</value>
|
||||
<data name="AutoCompleteBox" xml:space="preserve">
|
||||
<value>AutoCompleteBox</value>
|
||||
</data>
|
||||
<data name="Watermark" xml:space="preserve">
|
||||
<value>Watermark</value>
|
||||
@@ -807,4 +807,7 @@
|
||||
<data name="CloseMainWindowDialog" xml:space="preserve">
|
||||
<value>Close main window dialog</value>
|
||||
</data>
|
||||
<data name="HyperlinkButton" xml:space="preserve">
|
||||
<value>HyperlinkButton</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1866,5 +1866,20 @@
|
||||
</DrawingGroup>
|
||||
</DrawingBrush.Drawing>
|
||||
</DrawingBrush>
|
||||
|
||||
<DrawingBrush x:Key="Brush.Hyperlink">
|
||||
<DrawingBrush.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="#00FFFFFF"
|
||||
Geometry="F1M16,16L0,16 0,0 16,0z" />
|
||||
<GeometryDrawing Brush="#FFF6F6F6"
|
||||
Geometry="F1M6.2793,-0.000199999999999534L1.6123,13.9998 2.0003,13.9998 2.0003,15.9998 14.0003,15.9998 14.0003,13.9998 14.3873,13.9998 9.7213,-0.000199999999999534z" />
|
||||
<GeometryDrawing Brush="#FF00529C"
|
||||
Geometry="F1M3,14L13,14 13,15 3,15z M8,4L9.333,8 6.667,8z M6,10L10,10 11,13 13,13 9,1 7,1 3,13 5,13z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingBrush.Drawing>
|
||||
</DrawingBrush>
|
||||
<!--endregion-->
|
||||
</ResourceDictionary>
|
||||
@@ -1,26 +1,24 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
x:Class="HandyControlDemo.UserControl.CheckBoxDemo">
|
||||
<StackPanel Margin="32"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<hc:UniformSpacingPanel Margin="32"
|
||||
Spacing="16"
|
||||
Orientation="Vertical"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<CheckBox Content="CheckBox"
|
||||
IsChecked="True" />
|
||||
<CheckBox Margin="0,16,0,0"
|
||||
Content="CheckBox"
|
||||
<CheckBox Content="CheckBox"
|
||||
IsChecked="True"
|
||||
IsEnabled="False" />
|
||||
<CheckBox Margin="0,16,0,0"
|
||||
Content="CheckBox" />
|
||||
<CheckBox Margin="0,16,0,0"
|
||||
Content="CheckBox"
|
||||
<CheckBox Content="CheckBox" />
|
||||
<CheckBox Content="CheckBox"
|
||||
IsEnabled="False" />
|
||||
<CheckBox Margin="0,16,0,0"
|
||||
Content="CheckBox"
|
||||
<CheckBox Content="CheckBox"
|
||||
IsChecked="{x:Null}" />
|
||||
<CheckBox Margin="0,16,0,0"
|
||||
Content="CheckBox"
|
||||
<CheckBox Content="CheckBox"
|
||||
IsChecked="{x:Null}"
|
||||
IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</hc:UniformSpacingPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,69 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
x:Class="HandyControlDemo.UserControl.HyperlinkButtonDemo">
|
||||
<hc:UniformSpacingPanel Margin="32"
|
||||
Spacing="32"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
ItemVerticalAlignment="Top">
|
||||
<Border Theme="{StaticResource BorderRegion}">
|
||||
<hc:UniformSpacingPanel Spacing="16"
|
||||
Orientation="Vertical">
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl"
|
||||
IsEnabled="False" />
|
||||
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost primary"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost success"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost info"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost warning"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost danger"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
</hc:UniformSpacingPanel>
|
||||
</Border>
|
||||
<Border Theme="{StaticResource BorderRegion}">
|
||||
<hc:UniformSpacingPanel Spacing="16"+
|
||||
|
||||
Orientation="Vertical">
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="small"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="small"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl"
|
||||
IsEnabled="False" />
|
||||
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost primary small"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost success small"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost info small"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost warning small"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
<HyperlinkButton Content="HandyControl"
|
||||
Classes="ghost danger small"
|
||||
NavigateUri="https://github.com/HandyOrg/HandyControl" />
|
||||
</hc:UniformSpacingPanel>
|
||||
</Border>
|
||||
</hc:UniformSpacingPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class HyperlinkButtonDemo : Avalonia.Controls.UserControl
|
||||
{
|
||||
public HyperlinkButtonDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,16 @@ public class BackgroundSwitchElement
|
||||
public static IBrush GetMouseHoverBackground(AvaloniaObject element) =>
|
||||
element.GetValue(MouseHoverBackgroundProperty);
|
||||
|
||||
public static readonly AttachedProperty<IBrush> MouseHoverForegroundProperty =
|
||||
AvaloniaProperty.RegisterAttached<BackgroundSwitchElement, AvaloniaObject, IBrush>("MouseHoverForeground",
|
||||
defaultValue: Brushes.Transparent, inherits: true);
|
||||
|
||||
public static void SetMouseHoverForeground(AvaloniaObject element, IBrush value) =>
|
||||
element.SetValue(MouseHoverForegroundProperty, value);
|
||||
|
||||
public static IBrush GetMouseHoverForeground(AvaloniaObject element) =>
|
||||
element.GetValue(MouseHoverForegroundProperty);
|
||||
|
||||
public static readonly AttachedProperty<IBrush> MouseDownBackgroundProperty =
|
||||
AvaloniaProperty.RegisterAttached<BackgroundSwitchElement, AvaloniaObject, IBrush>("MouseDownBackground",
|
||||
defaultValue: Brushes.Transparent, inherits: true);
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:ClassModifier="internal"
|
||||
xmlns:hc="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<ControlTheme x:Key="HyperlinkButtonBaseStyle"
|
||||
TargetType="HyperlinkButton">
|
||||
<Setter Property="Cursor"
|
||||
Value="Hand" />
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource PrimaryTextBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="Transparent" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="0" />
|
||||
<Setter Property="Height"
|
||||
Value="{StaticResource DefaultControlHeight}" />
|
||||
<Setter Property="Padding"
|
||||
Value="{StaticResource DefaultControlPadding}" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="TextBlock.TextDecorations"
|
||||
Value="Underline" />
|
||||
<Setter Property="hc:BorderElement.CornerRadius"
|
||||
Value="{StaticResource DefaultCornerRadius}" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="{Binding $self.(hc:BorderElement.CornerRadius)}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<ContentPresenter x:Name="PART_ContentPresenter"
|
||||
Background="{TemplateBinding Background}"
|
||||
BackgroundSizing="{TemplateBinding BackgroundSizing}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
RecognizesAccessKey="True"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity"
|
||||
Value="0.9" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Opacity"
|
||||
Value="0.6" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Opacity"
|
||||
Value="0.4" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type HyperlinkButton}"
|
||||
BasedOn="{StaticResource HyperlinkButtonBaseStyle}"
|
||||
TargetType="HyperlinkButton" />
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,62 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:ClassModifier="internal"
|
||||
xmlns:hc="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<Style Selector="HyperlinkButton.ghost">
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
|
||||
Value="{DynamicResource SecondaryRegionBrush}" />
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
|
||||
Value="{DynamicResource PrimaryTextBrush}" />
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background"
|
||||
Value="{Binding $self.(hc:BackgroundSwitchElement.MouseHoverBackground)}" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{Binding $self.(hc:BackgroundSwitchElement.MouseHoverForeground)}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="HyperlinkButton.primary">
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
|
||||
Value="{DynamicResource PrimaryBrush}" />
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="HyperlinkButton.success">
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
|
||||
Value="{DynamicResource SuccessBrush}" />
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="HyperlinkButton.info">
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
|
||||
Value="{DynamicResource InfoBrush}" />
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="HyperlinkButton.warning">
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
|
||||
Value="{DynamicResource WarningBrush}" />
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="HyperlinkButton.danger">
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
|
||||
Value="{DynamicResource DangerBrush}" />
|
||||
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="HyperlinkButton.small">
|
||||
<Setter Property="Height"
|
||||
Value="20" />
|
||||
<Setter Property="Padding"
|
||||
Value="6,1" />
|
||||
</Style>
|
||||
|
||||
</Styles>
|
||||
@@ -32,6 +32,7 @@
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/UserControl.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/Window.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/Button.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/HyperlinkButton.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/RepeatButton.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/ToggleButton.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/RadioButton.axaml" />
|
||||
@@ -60,4 +61,6 @@
|
||||
</ResourceDictionary>
|
||||
</Styles.Resources>
|
||||
|
||||
<StyleInclude Source="avares://HandyControl/Themes/Styles/HyperlinkButton.classes.axaml" />
|
||||
|
||||
</Styles>
|
||||
@@ -6,13 +6,13 @@
|
||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<hc:UniformSpacingPanel Margin="32" Spacing="16" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<CheckBox Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsChecked="True"/>
|
||||
<CheckBox Margin="0,16,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsChecked="True" IsEnabled="False"/>
|
||||
<CheckBox Margin="0,16,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}"/>
|
||||
<CheckBox Margin="0,16,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsEnabled="False"/>
|
||||
<CheckBox Margin="0,16,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsChecked="{x:Null}"/>
|
||||
<CheckBox Margin="0,16,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsChecked="{x:Null}" IsEnabled="False"/>
|
||||
</StackPanel>
|
||||
<CheckBox Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsChecked="True" IsEnabled="False"/>
|
||||
<CheckBox Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}"/>
|
||||
<CheckBox Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsEnabled="False"/>
|
||||
<CheckBox Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsChecked="{x:Null}"/>
|
||||
<CheckBox Content="{ex:Lang Key={x:Static langs:LangKeys.CheckBox}}" IsChecked="{x:Null}" IsEnabled="False"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
Reference in new issue
Block a user