Skip to content

Commit

Permalink
Add default style for hyperlink (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
benruehl committed Mar 18, 2019
1 parent 3d4bf48 commit 563065a
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AdonisUI.ClassicTheme/AdonisUI.ClassicTheme.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="DefaultStyles\Hyperlink.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="DefaultStyles\TreeView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
18 changes: 18 additions & 0 deletions AdonisUI.ClassicTheme/DefaultStyles/Hyperlink.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI">

<Style x:Key="{x:Type Hyperlink}" TargetType="Hyperlink">
<Setter Property="Foreground" Value="{DynamicResource {x:Static adonisUi:Brushes.HyperlinkBrush}}"/>
<Setter Property="TextDecorations" Value="None"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="TextDecorations" Value="Underline"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}"/>
</Trigger>
</Style.Triggers>
</Style>

</ResourceDictionary>
1 change: 1 addition & 0 deletions AdonisUI.ClassicTheme/Resources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/DefaultStyles/DatePicker.xaml"/>
<ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/DefaultStyles/GridSplitter.xaml"/>
<ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/DefaultStyles/GroupBox.xaml"/>
<ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/DefaultStyles/Hyperlink.xaml"/>
<ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/DefaultStyles/Label.xaml"/>
<ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/DefaultStyles/ListBox.xaml"/>
<ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/DefaultStyles/ListView.xaml"/>
Expand Down
6 changes: 6 additions & 0 deletions AdonisUI.Demo/Views/LayerDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="{adonisUi:Space 1}"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="{adonisUi:Space 1}"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<Label Content="Label"
Expand All @@ -220,6 +222,10 @@
TextWrapping="Wrap"
Grid.Row="2"/>

<TextBlock Grid.Row="4">
<Hyperlink NavigateUri="https://github.com/benruehl/adonis-ui">Hyperlink</Hyperlink>
</TextBlock>

</Grid>

</DataTemplate>
Expand Down
1 change: 1 addition & 0 deletions AdonisUI/Brushes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ public static class Brushes

public static ComponentResourceKey ErrorBrush => new ComponentResourceKey(typeof(Brushes), "ErrorBrush");
public static ComponentResourceKey AlertBrush => new ComponentResourceKey(typeof(Brushes), "AlertBrush");
public static ComponentResourceKey HyperlinkBrush => new ComponentResourceKey(typeof(Brushes), "HyperlinkBrush");
}
}
2 changes: 2 additions & 0 deletions AdonisUI/ColorSchemes/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

<Color x:Key="{x:Static adonisUi:Colors.ErrorColor}">#b00020</Color>
<Color x:Key="{x:Static adonisUi:Colors.AlertColor}">#ffc107</Color>
<Color x:Key="{x:Static adonisUi:Colors.HyperlinkColor}">#3377c6</Color>

<!-- brushes -->

Expand Down Expand Up @@ -125,5 +126,6 @@

<SolidColorBrush x:Key="{x:Static adonisUi:Brushes.ErrorBrush}" Color="{DynamicResource {x:Static adonisUi:Colors.ErrorColor}}"/>
<SolidColorBrush x:Key="{x:Static adonisUi:Brushes.AlertBrush}" Color="{DynamicResource {x:Static adonisUi:Colors.AlertColor}}"/>
<SolidColorBrush x:Key="{x:Static adonisUi:Brushes.HyperlinkBrush}" Color="{DynamicResource {x:Static adonisUi:Colors.HyperlinkColor}}"/>

</ResourceDictionary>
2 changes: 2 additions & 0 deletions AdonisUI/ColorSchemes/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

<Color x:Key="{x:Static adonisUi:Colors.ErrorColor}">#dd2c00</Color>
<Color x:Key="{x:Static adonisUi:Colors.AlertColor}">#ffa000</Color>
<Color x:Key="{x:Static adonisUi:Colors.HyperlinkColor}">#0645ad</Color>

<!-- brushes -->

Expand Down Expand Up @@ -125,5 +126,6 @@

<SolidColorBrush x:Key="{x:Static adonisUi:Brushes.ErrorBrush}" Color="{DynamicResource {x:Static adonisUi:Colors.ErrorColor}}"/>
<SolidColorBrush x:Key="{x:Static adonisUi:Brushes.AlertBrush}" Color="{DynamicResource {x:Static adonisUi:Colors.AlertColor}}"/>
<SolidColorBrush x:Key="{x:Static adonisUi:Brushes.HyperlinkBrush}" Color="{DynamicResource {x:Static adonisUi:Colors.HyperlinkColor}}"/>

</ResourceDictionary>
1 change: 1 addition & 0 deletions AdonisUI/Colors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ public static class Colors

public static ComponentResourceKey ErrorColor => new ComponentResourceKey(typeof(Colors), "ErrorColor");
public static ComponentResourceKey AlertColor => new ComponentResourceKey(typeof(Colors), "AlertColor");
public static ComponentResourceKey HyperlinkColor => new ComponentResourceKey(typeof(Colors), "HyperlinkColor");
}
}

0 comments on commit 563065a

Please sign in to comment.