diff --git a/src/UniGetUI.Avalonia/Infrastructure/WindowsAppNotificationBridge.cs b/src/UniGetUI.Avalonia/Infrastructure/WindowsAppNotificationBridge.cs
index 8b6a76f71..425fa4e25 100644
--- a/src/UniGetUI.Avalonia/Infrastructure/WindowsAppNotificationBridge.cs
+++ b/src/UniGetUI.Avalonia/Infrastructure/WindowsAppNotificationBridge.cs
@@ -32,8 +32,8 @@ internal static class WindowsAppNotificationBridge
private static readonly string[] _assemblyCandidates =
{
- "Microsoft.Windows.AppNotifications",
- "Microsoft.WindowsAppSDK",
+ "Microsoft.Windows.AppNotifications.Projection",
+ "Microsoft.Windows.AppNotifications.Builder.Projection",
};
public static bool ShowProgress(AbstractOperation operation)
@@ -384,9 +384,6 @@ private static bool EnsureRegistered()
return _isRegistered;
}
- managerType.GetMethod("Register", BindingFlags.Public | BindingFlags.Instance)
- ?.Invoke(_managerDefault, null);
-
_removeByTagAsyncMethod = managerType.GetMethod(
"RemoveByTagAsync",
BindingFlags.Public | BindingFlags.Instance,
@@ -416,6 +413,14 @@ private static bool EnsureRegistered()
notifEventInfo.AddEventHandler(_managerDefault, lambda.Compile());
}
+ managerType.GetMethod(
+ "Register",
+ BindingFlags.Public | BindingFlags.Instance,
+ binder: null,
+ types: Type.EmptyTypes,
+ modifiers: null)
+ ?.Invoke(_managerDefault, null);
+
_isRegistered = _showMethod is not null;
}
catch (Exception ex)
@@ -495,9 +500,19 @@ private static bool ShowTextToast(
private static object InvokeFluent(object instance, string methodName, params object?[] args)
{
- return instance.GetType().GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance)
- ?.Invoke(instance, args)
- ?? instance;
+ Type type = instance.GetType();
+ Type[] argTypes = args.Select(a => a?.GetType() ?? typeof(object)).ToArray();
+
+ MethodInfo? method = type.GetMethod(
+ methodName,
+ BindingFlags.Public | BindingFlags.Instance,
+ binder: null,
+ types: argTypes,
+ modifiers: null)
+ ?? type.GetMethods(BindingFlags.Public | BindingFlags.Instance)
+ .FirstOrDefault(m => m.Name == methodName && m.GetParameters().Length == args.Length);
+
+ return method?.Invoke(instance, args) ?? instance;
}
private static void SetPropertyIfPresent(object instance, string propertyName, object value)
diff --git a/src/UniGetUI.Avalonia/UniGetUI.Avalonia.csproj b/src/UniGetUI.Avalonia/UniGetUI.Avalonia.csproj
index 627aa0d4f..3df4fe10b 100644
--- a/src/UniGetUI.Avalonia/UniGetUI.Avalonia.csproj
+++ b/src/UniGetUI.Avalonia/UniGetUI.Avalonia.csproj
@@ -29,6 +29,22 @@
false
+
+ None
+ true
+ true
+ false
+ $(NoWarn);MVVMTK0045
+ win-x64;win-arm64
+ win-arm64
+ win-$(Platform)
+ win-x64
+
+
+
+
+
+
$(RuntimeIdentifier)
win-arm64