diff --git a/DesktopNotifications.Avalonia/AppBuilderExtensions.cs b/DesktopNotifications.Avalonia/AppBuilderExtensions.cs
new file mode 100644
index 0000000..f5abe94
--- /dev/null
+++ b/DesktopNotifications.Avalonia/AppBuilderExtensions.cs
@@ -0,0 +1,55 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Platform;
+using DesktopNotifications.FreeDesktop;
+using DesktopNotifications.Windows;
+
+namespace DesktopNotifications.Avalonia
+{
+ ///
+ /// Extensions for
+ ///
+ public static class AppBuilderExtensions
+ {
+ ///
+ /// Setups the for the current platform and
+ /// binds it to the service locator ().
+ ///
+ ///
+ ///
+ ///
+ public static TAppBuilder SetupDesktopNotifications(this TAppBuilder builder)
+ where TAppBuilder : AppBuilderBase, new()
+ {
+ return builder.AfterSetup(async b =>
+ {
+ var runtimeInfo = b.RuntimePlatform.GetRuntimeInfo();
+ INotificationManager manager;
+
+ switch (runtimeInfo.OperatingSystem)
+ {
+ case OperatingSystemType.WinNT:
+ {
+ var context = WindowsApplicationContext.FromCurrentProcess(b.Instance.Name);
+ manager = new WindowsNotificationManager(context);
+ break;
+ }
+
+ case OperatingSystemType.Linux:
+ {
+ var context = FreeDesktopApplicationContext.FromCurrentProcess();
+ manager = new FreeDesktopNotificationManager(context);
+ break;
+ }
+
+ //TODO: OSX once implemented/stable
+ default: return;
+ }
+
+ await manager.Initialize();
+
+ AvaloniaLocator.CurrentMutable.Bind().ToConstant(manager);
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/DesktopNotifications.Avalonia/DesktopNotifications.Avalonia.csproj b/DesktopNotifications.Avalonia/DesktopNotifications.Avalonia.csproj
new file mode 100644
index 0000000..4fa204a
--- /dev/null
+++ b/DesktopNotifications.Avalonia/DesktopNotifications.Avalonia.csproj
@@ -0,0 +1,17 @@
+
+
+
+ netcoreapp3.1
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DesktopNotifications.sln b/DesktopNotifications.sln
index 3a20aff..733a4fe 100644
--- a/DesktopNotifications.sln
+++ b/DesktopNotifications.sln
@@ -11,7 +11,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example", "Example\Example.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopNotifications.FreeDesktop", "DesktopNotifications.FreeDesktop\DesktopNotifications.FreeDesktop.csproj", "{96F637EF-FD11-41F5-8F40-4E37313697E3}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopNotifications.Apple", "DesktopNotifications.Apple\DesktopNotifications.Apple.csproj", "{B4A6C639-79C4-48EF-955F-273CF01D7770}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopNotifications.Apple", "DesktopNotifications.Apple\DesktopNotifications.Apple.csproj", "{B4A6C639-79C4-48EF-955F-273CF01D7770}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesktopNotifications.Avalonia", "DesktopNotifications.Avalonia\DesktopNotifications.Avalonia.csproj", "{5D9904D2-E102-409D-AAFE-394A3DED40D9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.Avalonia", "Example.Avalonia\Example.Avalonia.csproj", "{4408FE39-C5AF-453D-B6EE-E1A42504264A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -39,6 +43,14 @@ Global
{B4A6C639-79C4-48EF-955F-273CF01D7770}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4A6C639-79C4-48EF-955F-273CF01D7770}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4A6C639-79C4-48EF-955F-273CF01D7770}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5D9904D2-E102-409D-AAFE-394A3DED40D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5D9904D2-E102-409D-AAFE-394A3DED40D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5D9904D2-E102-409D-AAFE-394A3DED40D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5D9904D2-E102-409D-AAFE-394A3DED40D9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4408FE39-C5AF-453D-B6EE-E1A42504264A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4408FE39-C5AF-453D-B6EE-E1A42504264A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4408FE39-C5AF-453D-B6EE-E1A42504264A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4408FE39-C5AF-453D-B6EE-E1A42504264A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Example.Avalonia/App.axaml b/Example.Avalonia/App.axaml
new file mode 100644
index 0000000..5143a3d
--- /dev/null
+++ b/Example.Avalonia/App.axaml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/Example.Avalonia/App.axaml.cs b/Example.Avalonia/App.axaml.cs
new file mode 100644
index 0000000..8e1a798
--- /dev/null
+++ b/Example.Avalonia/App.axaml.cs
@@ -0,0 +1,24 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+
+namespace Example.Avalonia
+{
+ public class App : Application
+ {
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
+ desktop.MainWindow = new MainWindow();
+ }
+
+ base.OnFrameworkInitializationCompleted();
+ }
+ }
+}
diff --git a/Example.Avalonia/Example.Avalonia.csproj b/Example.Avalonia/Example.Avalonia.csproj
new file mode 100644
index 0000000..c51e7e1
--- /dev/null
+++ b/Example.Avalonia/Example.Avalonia.csproj
@@ -0,0 +1,15 @@
+
+
+ WinExe
+ netcoreapp3.1
+ enable
+
+
+
+
+
+
+
+
+
+
diff --git a/Example.Avalonia/MainWindow.axaml b/Example.Avalonia/MainWindow.axaml
new file mode 100644
index 0000000..f555638
--- /dev/null
+++ b/Example.Avalonia/MainWindow.axaml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+ Events:
+
+
+
+
\ No newline at end of file
diff --git a/Example.Avalonia/MainWindow.axaml.cs b/Example.Avalonia/MainWindow.axaml.cs
new file mode 100644
index 0000000..5355b0f
--- /dev/null
+++ b/Example.Avalonia/MainWindow.axaml.cs
@@ -0,0 +1,62 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+using DesktopNotifications;
+
+namespace Example.Avalonia
+{
+ public class MainWindow : Window
+ {
+ private readonly TextBox _bodyTextBox;
+ private readonly ListBox _eventsListBox;
+ private readonly TextBox _titleTextBox;
+ private readonly INotificationManager _notificationManager;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+#if DEBUG
+ this.AttachDevTools();
+#endif
+
+ _titleTextBox = this.FindControl("TitleTextBox");
+ _bodyTextBox = this.FindControl("BodyTextBox");
+ _eventsListBox = this.FindControl("EventsListBox");
+ _eventsListBox.Items = new ObservableCollection();
+
+ _notificationManager = AvaloniaLocator.Current.GetService();
+ _notificationManager.NotificationActivated += OnNotificationActivated;
+ _notificationManager.NotificationDismissed += OnNotificationDismissed;
+ }
+
+ private void OnNotificationDismissed(object? sender, NotificationDismissedEventArgs e)
+ {
+ ((IList) _eventsListBox.Items).Add($"Notification dismissed: {e.Reason}");
+ }
+
+ private void OnNotificationActivated(object? sender, NotificationActivatedEventArgs e)
+ {
+ ((IList) _eventsListBox.Items).Add($"Notification activated: {e.ActionId}");
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public void Button_OnClick(object? sender, RoutedEventArgs e)
+ {
+ Debug.Assert(_notificationManager != null);
+
+ _notificationManager.ShowNotification(new Notification
+ {
+ Title = _titleTextBox.Text ?? _titleTextBox.Watermark,
+ Body = _bodyTextBox.Text ?? _bodyTextBox.Watermark
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/Example.Avalonia/Program.cs b/Example.Avalonia/Program.cs
new file mode 100644
index 0000000..3857b02
--- /dev/null
+++ b/Example.Avalonia/Program.cs
@@ -0,0 +1,22 @@
+using Avalonia;
+using DesktopNotifications.Avalonia;
+
+namespace Example.Avalonia
+{
+ internal class Program
+ {
+ public static void Main(string[] args)
+ {
+ BuildAvaloniaApp()
+ .StartWithClassicDesktopLifetime(args);
+ }
+
+ public static AppBuilder BuildAvaloniaApp()
+ {
+ return AppBuilder.Configure()
+ .UsePlatformDetect()
+ .SetupDesktopNotifications()
+ .LogToTrace();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Example.Avalonia/nuget.config b/Example.Avalonia/nuget.config
new file mode 100644
index 0000000..6c273ab
--- /dev/null
+++ b/Example.Avalonia/nuget.config
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+