mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix hotkey can't register
This commit is contained in:
@@ -21,8 +21,6 @@ namespace Snap.Hutao.Control.Image;
|
||||
[DependencyProperty("CachedName", typeof(string), "Unknown")]
|
||||
internal sealed partial class CachedImage : Implementation.ImageEx
|
||||
{
|
||||
private string? file;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的缓存图像
|
||||
/// </summary>
|
||||
@@ -43,7 +41,6 @@ internal sealed partial class CachedImage : Implementation.ImageEx
|
||||
HutaoException.ThrowIf(string.IsNullOrEmpty(imageUri.Host), SH.ControlImageCachedImageInvalidResourceUri);
|
||||
string file = await imageCache.GetFileFromCacheAsync(imageUri).ConfigureAwait(true); // BitmapImage need to be created by main thread.
|
||||
CachedName = Path.GetFileName(file);
|
||||
this.file = file;
|
||||
token.ThrowIfCancellationRequested(); // check token state to determine whether the operation should be canceled.
|
||||
return file.ToUri();
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
return;
|
||||
}
|
||||
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
serviceProvider.GetRequiredService<HotKeyOptions>().RegisterAll();
|
||||
|
||||
if (serviceProvider.GetRequiredService<AppOptions>().IsNotifyIconEnabled)
|
||||
|
||||
Reference in New Issue
Block a user