Browse Source

Notification control is not notification card and simple notification is now Notification.

pull/2453/head
Dan Walmsley 8 years ago
parent
commit
41102bad24
  1. 4
      samples/ControlCatalog/ViewModels/MainWindowViewModel.cs
  2. 4
      samples/ControlCatalog/ViewModels/NotificationViewModel.cs
  3. 4
      samples/ControlCatalog/Views/NotificationView.xaml
  4. 186
      src/Avalonia.Controls/Notifications/Notification.cs
  5. 176
      src/Avalonia.Controls/Notifications/NotificationCard.cs
  6. 10
      src/Avalonia.Controls/Notifications/NotificationType.cs
  7. 56
      src/Avalonia.Controls/Notifications/SimpleNotification.cs
  8. 10
      src/Avalonia.Controls/Notifications/WindowNotificationManager.cs
  9. 10
      src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj
  10. 1
      src/Avalonia.Themes.Default/DefaultTheme.xaml
  11. 100
      src/Avalonia.Themes.Default/NotificationCard.xaml
  12. 98
      src/Avalonia.Themes.Default/WindowNotificationManager.xaml

4
samples/ControlCatalog/ViewModels/MainWindowViewModel.cs

@ -20,12 +20,12 @@ namespace ControlCatalog.ViewModels
ShowManagedNotificationCommand = ReactiveCommand.Create(() =>
{
NotificationManager.Show(SimpleNotification.Create("Welcome", "Avalonia now supports Notifications.", NotificationType.Information));
NotificationManager.Show(new Avalonia.Controls.Notifications.Notification("Welcome", "Avalonia now supports Notifications.", NotificationType.Information));
});
ShowNativeNotificationCommand = ReactiveCommand.Create(() =>
{
NotificationManager.Show(SimpleNotification.Create("Error", "Native Notifications are not quite ready. Coming soon.", NotificationType.Error));
NotificationManager.Show(new Avalonia.Controls.Notifications.Notification("Error", "Native Notifications are not quite ready. Coming soon.", NotificationType.Error));
});
}

4
samples/ControlCatalog/ViewModels/NotificationViewModel.cs

@ -10,12 +10,12 @@ namespace ControlCatalog.ViewModels
{
YesCommand = ReactiveCommand.Create(() =>
{
manager.Show(SimpleNotification.Create("Avalonia Notifications", "Start adding notifications to your app today."));
manager.Show(new Avalonia.Controls.Notifications.Notification("Avalonia Notifications", "Start adding notifications to your app today."));
});
NoCommand = ReactiveCommand.Create(() =>
{
manager.Show(SimpleNotification.Create("Avalonia Notifications", "Start adding notifications to your app today. To find out more visit..."));
manager.Show(new Avalonia.Controls.Notifications.Notification("Avalonia Notifications", "Start adding notifications to your app today. To find out more visit..."));
});
}

4
samples/ControlCatalog/Views/NotificationView.xaml

@ -9,8 +9,8 @@
<DockPanel Grid.Column="1">
<TextBlock DockPanel.Dock="Top" Text="{Binding Title}" FontWeight="Medium" />
<StackPanel Spacing="20" DockPanel.Dock="Bottom" Margin="0,8,0,0" Orientation="Horizontal">
<Button Content="No" DockPanel.Dock="Right" Notification.CloseOnClick="True" Command="{Binding NoCommand}" Margin="0,0,8,0" />
<Button Content="Yes" DockPanel.Dock="Right" Notification.CloseOnClick="True" Command="{Binding YesCommand}" />
<Button Content="No" DockPanel.Dock="Right" NotificationCard.CloseOnClick="True" Command="{Binding NoCommand}" Margin="0,0,8,0" />
<Button Content="Yes" DockPanel.Dock="Right" NotificationCard.CloseOnClick="True" Command="{Binding YesCommand}" />
</StackPanel>
<TextBlock Text="{Binding Message}" TextWrapping="Wrap" Opacity=".8" Margin="0,8,0,0"/>
</DockPanel>

186
src/Avalonia.Controls/Notifications/Notification.cs

@ -1,176 +1,40 @@
using System;
using System.Linq;
using System.Reactive.Linq;
using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
using Avalonia.LogicalTree;
namespace Avalonia.Controls.Notifications
{
public class Notification : ContentControl
/// <summary>
/// Defines content for a <see cref="NotificationCard"/> control.
/// </summary>
/// <remarks>
/// This notification content type is compatible with native notifications.
/// </remarks>
public class Notification : INotification
{
private bool _isClosed;
private bool _isClosing;
static Notification()
{
IsClosedProperty.Changed.AddClassHandler<Notification>(IsClosedChanged);
}
public Notification()
{
this.GetObservable(ContentProperty)
.OfType<SimpleNotification>()
.Subscribe(x =>
{
switch (x.Type)
{
case NotificationType.Error:
PseudoClasses.Add(":error");
break;
case NotificationType.Information:
PseudoClasses.Add(":information");
break;
case NotificationType.Success:
PseudoClasses.Add(":success");
break;
case NotificationType.Warning:
PseudoClasses.Add(":warning");
break;
}
});
}
/// <summary>
/// Determines if the notification is already closing.
/// </summary>
public bool IsClosing
{
get { return _isClosing; }
private set { SetAndRaise(IsClosingProperty, ref _isClosing, value); }
}
public static readonly DirectProperty<Notification, bool> IsClosingProperty =
AvaloniaProperty.RegisterDirect<Notification, bool>(nameof(IsClosing), o => o.IsClosing);
/// <summary>
/// Determines if the notification is closed.
/// </summary>
public bool IsClosed
{
get { return _isClosed; }
set { SetAndRaise(IsClosedProperty, ref _isClosed, value); }
}
/// <summary>
/// Defines the <see cref="IsClosed"/> property.
/// </summary>
public static readonly DirectProperty<Notification, bool> IsClosedProperty =
AvaloniaProperty.RegisterDirect<Notification, bool>(nameof(IsClosed), o => o.IsClosed, (o, v) => o.IsClosed = v);
/// <summary>
/// Defines the <see cref="NotificationCloseInvoked"/> event.
/// </summary>
public static readonly RoutedEvent<RoutedEventArgs> NotificationCloseInvokedEvent =
RoutedEvent.Register<Notification, RoutedEventArgs>(nameof(NotificationCloseInvoked), RoutingStrategies.Bubble);
/// <summary>
/// Defines the <see cref="NotificationClosed"/> event.
/// </summary>
public static readonly RoutedEvent<RoutedEventArgs> NotificationClosedEvent =
RoutedEvent.Register<Notification, RoutedEventArgs>(nameof(NotificationClosed), RoutingStrategies.Bubble);
/// <summary>
/// Raised when notification close event is invoked.
/// </summary>
public event EventHandler<RoutedEventArgs> NotificationCloseInvoked
{
add { AddHandler(NotificationCloseInvokedEvent, value); }
remove { RemoveHandler(NotificationCloseInvokedEvent, value); }
}
public event EventHandler<RoutedEventArgs> NotificationClosed
{
add { AddHandler(NotificationClosedEvent, value); }
remove { RemoveHandler(NotificationClosedEvent, value); }
}
public static bool GetCloseOnClick(Notification obj)
{
return (bool)obj.GetValue(CloseOnClickProperty);
}
public static void SetCloseOnClick(Notification obj, bool value)
{
obj.SetValue(CloseOnClickProperty, value);
}
public static readonly AvaloniaProperty CloseOnClickProperty =
AvaloniaProperty.RegisterAttached<Button, bool>("CloseOnClick", typeof(Notification), validate: CloseOnClickChanged);
private static bool CloseOnClickChanged(Button button, bool value)
{
if (value)
{
button.Click += Button_Click;
}
else
{
button.Click -= Button_Click;
}
return true;
}
private static void Button_Click(object sender, RoutedEventArgs e)
{
var btn = sender as ILogical;
var notification = btn.GetLogicalAncestors().OfType<Notification>().FirstOrDefault();
notification?.Close();
}
protected override void OnTemplateApplied(TemplateAppliedEventArgs e)
public Notification(string title,
string message,
NotificationType type = NotificationType.Information,
TimeSpan? expiration = null,
Action onClick = null,
Action onClose = null)
{
base.OnTemplateApplied(e);
var closeButton = this.FindControl<Button>("PART_CloseButton");
if (closeButton != null)
closeButton.Click += OnCloseButtonOnClick;
Title = title;
Message = message;
Type = type;
Expiration = expiration.HasValue ? expiration.Value : TimeSpan.FromSeconds(5);
OnClick = onClick;
OnClose = onClose;
}
private void OnCloseButtonOnClick(object sender, RoutedEventArgs args)
{
var button = sender as Button;
if (button == null)
return;
button.Click -= OnCloseButtonOnClick;
Close();
}
public string Title { get; private set; }
public void Close()
{
if (IsClosing)
{
return;
}
public string Message { get; private set; }
IsClosing = true;
public NotificationType Type { get; private set; }
RaiseEvent(new RoutedEventArgs(NotificationCloseInvokedEvent));
}
public TimeSpan Expiration { get; private set; }
private static void IsClosedChanged(Notification target, AvaloniaPropertyChangedEventArgs arg2)
{
if (!target.IsClosing & !target.IsClosed)
{
return;
}
public Action OnClick { get; private set; }
target.RaiseEvent(new RoutedEventArgs(NotificationClosedEvent));
}
public Action OnClose { get; private set; }
}
}

176
src/Avalonia.Controls/Notifications/NotificationCard.cs

@ -0,0 +1,176 @@
using System;
using System.Linq;
using System.Reactive.Linq;
using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
using Avalonia.LogicalTree;
namespace Avalonia.Controls.Notifications
{
public class NotificationCard : ContentControl
{
private bool _isClosed;
private bool _isClosing;
static NotificationCard()
{
IsClosedProperty.Changed.AddClassHandler<NotificationCard>(IsClosedChanged);
}
public NotificationCard()
{
this.GetObservable(ContentProperty)
.OfType<Notification>()
.Subscribe(x =>
{
switch (x.Type)
{
case NotificationType.Error:
PseudoClasses.Add(":error");
break;
case NotificationType.Information:
PseudoClasses.Add(":information");
break;
case NotificationType.Success:
PseudoClasses.Add(":success");
break;
case NotificationType.Warning:
PseudoClasses.Add(":warning");
break;
}
});
}
/// <summary>
/// Determines if the notification is already closing.
/// </summary>
public bool IsClosing
{
get { return _isClosing; }
private set { SetAndRaise(IsClosingProperty, ref _isClosing, value); }
}
public static readonly DirectProperty<NotificationCard, bool> IsClosingProperty =
AvaloniaProperty.RegisterDirect<NotificationCard, bool>(nameof(IsClosing), o => o.IsClosing);
/// <summary>
/// Determines if the notification is closed.
/// </summary>
public bool IsClosed
{
get { return _isClosed; }
set { SetAndRaise(IsClosedProperty, ref _isClosed, value); }
}
/// <summary>
/// Defines the <see cref="IsClosed"/> property.
/// </summary>
public static readonly DirectProperty<NotificationCard, bool> IsClosedProperty =
AvaloniaProperty.RegisterDirect<NotificationCard, bool>(nameof(IsClosed), o => o.IsClosed, (o, v) => o.IsClosed = v);
/// <summary>
/// Defines the <see cref="NotificationCloseInvoked"/> event.
/// </summary>
public static readonly RoutedEvent<RoutedEventArgs> NotificationCloseInvokedEvent =
RoutedEvent.Register<NotificationCard, RoutedEventArgs>(nameof(NotificationCloseInvoked), RoutingStrategies.Bubble);
/// <summary>
/// Defines the <see cref="NotificationClosed"/> event.
/// </summary>
public static readonly RoutedEvent<RoutedEventArgs> NotificationClosedEvent =
RoutedEvent.Register<NotificationCard, RoutedEventArgs>(nameof(NotificationClosed), RoutingStrategies.Bubble);
/// <summary>
/// Raised when notification close event is invoked.
/// </summary>
public event EventHandler<RoutedEventArgs> NotificationCloseInvoked
{
add { AddHandler(NotificationCloseInvokedEvent, value); }
remove { RemoveHandler(NotificationCloseInvokedEvent, value); }
}
public event EventHandler<RoutedEventArgs> NotificationClosed
{
add { AddHandler(NotificationClosedEvent, value); }
remove { RemoveHandler(NotificationClosedEvent, value); }
}
public static bool GetCloseOnClick(NotificationCard obj)
{
return (bool)obj.GetValue(CloseOnClickProperty);
}
public static void SetCloseOnClick(NotificationCard obj, bool value)
{
obj.SetValue(CloseOnClickProperty, value);
}
public static readonly AvaloniaProperty CloseOnClickProperty =
AvaloniaProperty.RegisterAttached<Button, bool>("CloseOnClick", typeof(NotificationCard), validate: CloseOnClickChanged);
private static bool CloseOnClickChanged(Button button, bool value)
{
if (value)
{
button.Click += Button_Click;
}
else
{
button.Click -= Button_Click;
}
return true;
}
private static void Button_Click(object sender, RoutedEventArgs e)
{
var btn = sender as ILogical;
var notification = btn.GetLogicalAncestors().OfType<NotificationCard>().FirstOrDefault();
notification?.Close();
}
protected override void OnTemplateApplied(TemplateAppliedEventArgs e)
{
base.OnTemplateApplied(e);
var closeButton = this.FindControl<Button>("PART_CloseButton");
if (closeButton != null)
closeButton.Click += OnCloseButtonOnClick;
}
private void OnCloseButtonOnClick(object sender, RoutedEventArgs args)
{
var button = sender as Button;
if (button == null)
return;
button.Click -= OnCloseButtonOnClick;
Close();
}
public void Close()
{
if (IsClosing)
{
return;
}
IsClosing = true;
RaiseEvent(new RoutedEventArgs(NotificationCloseInvokedEvent));
}
private static void IsClosedChanged(NotificationCard target, AvaloniaPropertyChangedEventArgs arg2)
{
if (!target.IsClosing & !target.IsClosed)
{
return;
}
target.RaiseEvent(new RoutedEventArgs(NotificationClosedEvent));
}
}
}

10
src/Avalonia.Controls/Notifications/NotificationType.cs

@ -0,0 +1,10 @@
namespace Avalonia.Controls.Notifications
{
public enum NotificationType
{
Information,
Success,
Warning,
Error
}
}

56
src/Avalonia.Controls/Notifications/SimpleNotification.cs

@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Avalonia.Controls.Notifications
{
/// <summary>
/// Defines content for a <see cref="Notification"/> control.
/// </summary>
/// <remarks>
/// This notification content type is compatible with native notifications.
/// </remarks>
public class SimpleNotification : INotification
{
public static INotification Create (
string title,
string message,
NotificationType type = NotificationType.Information,
TimeSpan? expiration = null,
Action onClick = null,
Action onClose = null)
{
var result = new SimpleNotification
{
Title = title,
Message = message,
Type = type,
Expiration = expiration.HasValue ? expiration.Value : TimeSpan.FromSeconds(5),
OnClick = onClick,
OnClose = onClose
};
return result;
}
public string Title { get; private set; }
public string Message { get; private set; }
public NotificationType Type { get; private set; }
public TimeSpan Expiration { get; private set; }
public Action OnClick { get; private set; }
public Action OnClose { get; private set; }
}
public enum NotificationType
{
Information,
Success,
Warning,
Error
}
}

10
src/Avalonia.Controls/Notifications/WindowNotificationManager.cs

@ -99,7 +99,7 @@ namespace Avalonia.Controls.Notifications
{
var notification = content as INotification;
var notificationControl = new Notification
var notificationControl = new NotificationCard
{
Content = content
};
@ -116,7 +116,7 @@ namespace Avalonia.Controls.Notifications
if (notification != null && notification.OnClick != null)
{
notification.OnClick.Invoke();
(sender as Notification)?.Close();
(sender as NotificationCard)?.Close();
}
};
@ -124,9 +124,9 @@ namespace Avalonia.Controls.Notifications
{
_items.Add(notificationControl);
if (_items.OfType<Notification>().Count(i => !i.IsClosing) > MaxItems)
if (_items.OfType<NotificationCard>().Count(i => !i.IsClosing) > MaxItems)
{
_items.OfType<Notification>().First(i => !i.IsClosing).Close();
_items.OfType<NotificationCard>().First(i => !i.IsClosing).Close();
}
}
@ -142,7 +142,7 @@ namespace Avalonia.Controls.Notifications
private void OnNotificationClosed(object sender, RoutedEventArgs routedEventArgs)
{
var notification = sender as Notification;
var notification = sender as NotificationCard;
_items.Remove(notification);
}

10
src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj

@ -21,14 +21,4 @@
<Import Project="..\..\build\EmbedXaml.props" />
<Import Project="..\..\build\BuildTargets.targets" />
<Import Project="..\..\build\Rx.props" />
<ItemGroup>
<EmbeddedResource Update="NotificationArea.xaml">
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="WindowNotificationManager.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
</ItemGroup>
</Project>

1
src/Avalonia.Themes.Default/DefaultTheme.xaml

@ -47,4 +47,5 @@
<StyleInclude Source="resm:Avalonia.Themes.Default.NumericUpDown.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.AutoCompleteBox.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.WindowNotificationManager.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.NotificationCard.xaml?assembly=Avalonia.Themes.Default"/>
</Styles>

100
src/Avalonia.Themes.Default/NotificationCard.xaml

@ -0,0 +1,100 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="NotificationCard">
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="Width" Value="350"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="RenderTransformOrigin" Value="50%,75%"/>
<Setter Property="Template">
<ControlTemplate>
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Margin="8,8,0,0">
<ContentControl MinHeight="150" Content="{TemplateBinding Content}" />
</Border>
</LayoutTransformControl>
</ControlTemplate>
</Setter>
<Style.Animations>
<Animation Duration="0:0:0.45" Easing="QuadraticEaseIn" FillMode="Forward">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0"/>
<Setter Property="TranslateTransform.Y" Value="20"/>
<Setter Property="ScaleTransform.ScaleX" Value="0.85"/>
<Setter Property="ScaleTransform.ScaleY" Value="0.85"/>
</KeyFrame>
<KeyFrame Cue="30%">
<Setter Property="TranslateTransform.Y" Value="-20"/>
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="1"/>
<Setter Property="TranslateTransform.Y" Value="0"/>
<Setter Property="ScaleTransform.ScaleX" Value="1"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/>
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="NotificationCard[IsClosing=true] /template/ LayoutTransformControl#PART_LayoutTransformControl">
<Setter Property="RenderTransformOrigin" Value="50%,0%"/>
<Style.Animations>
<Animation Duration="0:0:0.75" Easing="QuadraticEaseOut" FillMode="Forward">
<KeyFrame Cue="0%">
<Setter Property="TranslateTransform.X" Value="0"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/>
</KeyFrame>
<KeyFrame Cue="70%">
<Setter Property="TranslateTransform.X" Value="800"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/>
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="ScaleTransform.ScaleY" Value="0"/>
<Setter Property="TranslateTransform.X" Value="800"/>
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="NotificationCard[IsClosing=true]">
<Style.Animations>
<Animation Duration="0:0:1.25" Easing="QuadraticEaseOut" FillMode="Forward">
<KeyFrame Cue="100%">
<Setter Property="IsClosed" Value="True"/>
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="NotificationCard /template/ Button#PART_CloseButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<TextBlock Text="X" FontSize="12" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
<Style Selector="NotificationCard">
<Setter Property="Background" Value="#444444"/>
</Style>
<Style Selector="NotificationCard:information">
<Setter Property="Background" Value="Teal"/>
</Style>
<Style Selector="NotificationCard:success">
<Setter Property="Background" Value="LimeGreen"/>
</Style>
<Style Selector="NotificationCard:warning">
<Setter Property="Background" Value="Orange"/>
</Style>
<Style Selector="NotificationCard:error">
<Setter Property="Background" Value="OrangeRed"/>
</Style>
</Styles>

98
src/Avalonia.Themes.Default/WindowNotificationManager.xaml

@ -21,104 +21,6 @@
</Setter>
</Style>
<Style Selector="Notification">
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="Width" Value="350"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="RenderTransformOrigin" Value="50%,75%"/>
<Setter Property="Template">
<ControlTemplate>
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Margin="8,8,0,0">
<ContentControl MinHeight="150" Content="{TemplateBinding Content}" />
</Border>
</LayoutTransformControl>
</ControlTemplate>
</Setter>
<Style.Animations>
<Animation Duration="0:0:0.45" Easing="QuadraticEaseIn" FillMode="Forward">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0"/>
<Setter Property="TranslateTransform.Y" Value="20"/>
<Setter Property="ScaleTransform.ScaleX" Value="0.85"/>
<Setter Property="ScaleTransform.ScaleY" Value="0.85"/>
</KeyFrame>
<KeyFrame Cue="30%">
<Setter Property="TranslateTransform.Y" Value="-20"/>
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="1"/>
<Setter Property="TranslateTransform.Y" Value="0"/>
<Setter Property="ScaleTransform.ScaleX" Value="1"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/>
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="Notification[IsClosing=true] /template/ LayoutTransformControl#PART_LayoutTransformControl">
<Setter Property="RenderTransformOrigin" Value="50%,0%"/>
<Style.Animations>
<Animation Duration="0:0:0.75" Easing="QuadraticEaseOut" FillMode="Forward">
<KeyFrame Cue="0%">
<Setter Property="TranslateTransform.X" Value="0"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/>
</KeyFrame>
<KeyFrame Cue="70%">
<Setter Property="TranslateTransform.X" Value="800"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/>
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="ScaleTransform.ScaleY" Value="0"/>
<Setter Property="TranslateTransform.X" Value="800"/>
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="Notification[IsClosing=true]">
<Style.Animations>
<Animation Duration="0:0:1.25" Easing="QuadraticEaseOut" FillMode="Forward">
<KeyFrame Cue="100%">
<Setter Property="IsClosed" Value="True"/>
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="Notification /template/ Button#PART_CloseButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<TextBlock Text="X" FontSize="12" />
</ControlTemplate>
</Setter.Value>
</Setter>
<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>
<Style Selector="Notification:success">
<Setter Property="Background" Value="LimeGreen"/>
</Style>
<Style Selector="Notification:warning">
<Setter Property="Background" Value="Orange"/>
</Style>
<Style Selector="Notification:error">
<Setter Property="Background" Value="OrangeRed"/>
</Style>
<Style Selector="WindowNotificationManager:topleft /template/ StackPanel#PART_Items">
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Left"/>

Loading…
Cancel
Save