Browse Source

fix custom notification styling

pull/2453/head
Dan Walmsley 8 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"> <Style Selector="NotificationArea">
<Setter Property="Margin" Value="0 0 8 8"/> <Setter Property="Margin" Value="0 0 8 8"/>
<Setter Property="Template"> <Setter Property="Template">
@ -6,11 +7,14 @@
<StackPanel Name="PART_Items"> <StackPanel Name="PART_Items">
<StackPanel.DataTemplates> <StackPanel.DataTemplates>
<DataTemplate DataType="NotificationContent"> <DataTemplate DataType="NotificationContent">
<StackPanel Spacing="8"> <StackPanel Spacing="8" Margin="12">
<TextBlock DockPanel.Dock="Top" Text="{Binding Title}" FontWeight="Medium" /> <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> </StackPanel>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="x:String">
<TextBlock Text="{Binding }" Margin="12" />
</DataTemplate>
</StackPanel.DataTemplates> </StackPanel.DataTemplates>
</StackPanel> </StackPanel>
</ControlTemplate> </ControlTemplate>
@ -29,8 +33,7 @@
<Border Background="{TemplateBinding Background}" <Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
Margin="8,8,0,0" Margin="8,8,0,0">
Padding="12">
<ContentControl MinHeight="150" Content="{TemplateBinding Content}" /> <ContentControl MinHeight="150" Content="{TemplateBinding Content}" />
</Border> </Border>
</LayoutTransformControl> </LayoutTransformControl>
@ -99,7 +102,10 @@
<Setter Property="HorizontalAlignment" Value="Right"/> <Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Top"/> <Setter Property="VerticalAlignment" Value="Top"/>
</Style> </Style>
<Style Selector="Notification">
<Setter Property="Background" Value="#444444"/>
</Style>
<Style Selector="Notification:information"> <Style Selector="Notification:information">
<Setter Property="Background" Value="Teal"/> <Setter Property="Background" Value="Teal"/>
</Style> </Style>

Loading…
Cancel
Save