Browse Source

fix custom notification styling

pull/2453/head
Dan Walmsley 7 years ago
parent
commit
9284f2c78f
  1. 18
      src/Avalonia.Themes.Default/NotificationArea.xaml

18
src/Avalonia.Themes.Default/NotificationArea.xaml

@ -1,4 +1,5 @@
<Styles xmlns="https://github.com/avaloniaui">
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="NotificationArea">
<Setter Property="Margin" Value="0 0 8 8"/>
<Setter Property="Template">
@ -6,11 +7,14 @@
<StackPanel Name="PART_Items">
<StackPanel.DataTemplates>
<DataTemplate DataType="NotificationContent">
<StackPanel Spacing="8">
<StackPanel Spacing="8" Margin="12">
<TextBlock DockPanel.Dock="Top" Text="{Binding Title}" FontWeight="Medium" />
<TextBlock MaxHeight="80" Text="{Binding Message}" TextWrapping="Wrap" Opacity=".8" Margin="0,0,12,0"/>
<TextBlock MaxHeight="80" Text="{Binding Message}" TextWrapping="Wrap" Margin="0,0,12,0"/>
</StackPanel>
</DataTemplate>
<DataTemplate DataType="x:String">
<TextBlock Text="{Binding }" Margin="12" />
</DataTemplate>
</StackPanel.DataTemplates>
</StackPanel>
</ControlTemplate>
@ -29,8 +33,7 @@
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Margin="8,8,0,0"
Padding="12">
Margin="8,8,0,0">
<ContentControl MinHeight="150" Content="{TemplateBinding Content}" />
</Border>
</LayoutTransformControl>
@ -99,7 +102,10 @@
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
<Style Selector="Notification">
<Setter Property="Background" Value="#444444"/>
</Style>
<Style Selector="Notification:information">
<Setter Property="Background" Value="Teal"/>
</Style>

Loading…
Cancel
Save