From b653815ddfa57e1b8cbb4c7b77d76128c249f32d Mon Sep 17 00:00:00 2001 From: Difegue Date: Tue, 2 Jul 2024 19:11:43 +0200 Subject: [PATCH] Swap to a maintained NotifyIcon implementation --- Karen/App.xaml | 4 ++-- Karen/App.xaml.cs | 7 +++++-- Karen/Karen.csproj | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Karen/App.xaml b/Karen/App.xaml index be2c426..12e8e77 100644 --- a/Karen/App.xaml +++ b/Karen/App.xaml @@ -3,8 +3,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Karen" - xmlns:tb="http://www.hardcodet.net/taskbar" - xmlns:ui="http://schemas.modernwpf.com/2019" + xmlns:ui="http://schemas.modernwpf.com/2019" + xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf" ShutdownMode="OnExplicitShutdown"> diff --git a/Karen/App.xaml.cs b/Karen/App.xaml.cs index a287697..9ecc409 100644 --- a/Karen/App.xaml.cs +++ b/Karen/App.xaml.cs @@ -1,7 +1,7 @@ using System; using System.Linq; using System.Windows; -using Hardcodet.Wpf.TaskbarNotification; +using H.NotifyIcon; using Karen.Interop; using Windows.ApplicationModel; using Windows.UI.Popups; @@ -18,7 +18,10 @@ namespace Karen public void ToastNotification(string text) { - notifyIcon.ShowBalloonTip("LANraragi", text, notifyIcon.Icon, true); + if (!notifyIcon.IsCreated) + notifyIcon.ForceCreate(); + + notifyIcon.ShowNotification("LANraragi", text); } public void ShowConfigWindow() diff --git a/Karen/Karen.csproj b/Karen/Karen.csproj index a385cb7..a4761ad 100644 --- a/Karen/Karen.csproj +++ b/Karen/Karen.csproj @@ -42,7 +42,7 @@ - +