NotificationStyle.axaml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <Design.PreviewWith>
  3. <Border Padding="20">
  4. <!-- Add Controls for Previewer Here -->
  5. </Border>
  6. </Design.PreviewWith>
  7. <Style Selector="WindowNotificationManager">
  8. <Setter Property="Margin" Value="0 0" />
  9. <Setter Property="Background" Value="Red" />
  10. <Setter Property="Template">
  11. <ControlTemplate>
  12. <ReversibleStackPanel Name="PART_Items">
  13. <ReversibleStackPanel.DataTemplates>
  14. <DataTemplate DataType="INotification">
  15. <StackPanel Margin="12"
  16. Background="{DynamicResource SukiBackground}"
  17. Spacing="8"
  18. TextBlock.Foreground="{DynamicResource SukiText}">
  19. <TextBlock FontSize="18"
  20. FontWeight="{DynamicResource DefaultDemiBold}"
  21. Text="{Binding Title}" />
  22. <TextBlock MaxHeight="80"
  23. Margin="0,0,12,0"
  24. Text="{Binding Message}"
  25. TextWrapping="Wrap" />
  26. </StackPanel>
  27. </DataTemplate>
  28. <DataTemplate DataType="x:String">
  29. <TextBlock Margin="12"
  30. Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}"
  31. Text="{Binding}" />
  32. </DataTemplate>
  33. </ReversibleStackPanel.DataTemplates>
  34. </ReversibleStackPanel>
  35. </ControlTemplate>
  36. </Setter>
  37. </Style>
  38. <Style Selector="WindowNotificationManager:topleft /template/ ReversibleStackPanel#PART_Items">
  39. <Setter Property="VerticalAlignment" Value="Top" />
  40. <Setter Property="HorizontalAlignment" Value="Left" />
  41. </Style>
  42. <Style Selector="WindowNotificationManager:topright /template/ ReversibleStackPanel#PART_Items">
  43. <Setter Property="VerticalAlignment" Value="Top" />
  44. <Setter Property="HorizontalAlignment" Value="Right" />
  45. </Style>
  46. <Style Selector="WindowNotificationManager:bottomleft /template/ ReversibleStackPanel#PART_Items">
  47. <Setter Property="ReverseOrder" Value="True" />
  48. <Setter Property="VerticalAlignment" Value="Bottom" />
  49. <Setter Property="HorizontalAlignment" Value="Left" />
  50. </Style>
  51. <Style Selector="WindowNotificationManager:bottomright /template/ ReversibleStackPanel#PART_Items">
  52. <Setter Property="ReverseOrder" Value="True" />
  53. <Setter Property="VerticalAlignment" Value="Bottom" />
  54. <Setter Property="HorizontalAlignment" Value="Right" />
  55. </Style>
  56. </Styles>