Swap to a maintained NotifyIcon implementation

This commit is contained in:
Difegue 2024-07-02 19:11:43 +02:00
parent b8d9e031c6
commit b653815ddf
3 changed files with 8 additions and 5 deletions

View File

@ -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">
<Application.Resources>

View File

@ -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()

View File

@ -42,7 +42,7 @@
<ItemGroup>
<PackageReference Include="DesktopBridge.Helpers" Version="1.2.2" />
<PackageReference Include="Emoji.Wpf" Version="0.3.3" />
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.131" />
<PackageReference Include="HideConsoleOnClose" Version="1.0.1" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.22000.196" />
<PackageReference Include="ModernWpfUI" Version="0.9.4" />