Use api function in main project

This commit is contained in:
Jack251970 2025-04-02 18:25:06 +08:00
parent 5165ce8f2a
commit f76110856f
5 changed files with 7 additions and 7 deletions

View file

@ -156,7 +156,7 @@ namespace Flow.Launcher
private async Task SetImageAsync(string imageName)
{
var imagePath = Path.Combine(Constant.ProgramDirectory, "Images", imageName);
var imageSource = await ImageLoader.LoadAsync(imagePath);
var imageSource = await App.API.LoadImageAsync(imagePath);
Img.Source = imageSource;
}

View file

@ -43,7 +43,7 @@ namespace Flow.Launcher
private async System.Threading.Tasks.Task LoadImageAsync()
{
imgClose.Source = await ImageLoader.LoadAsync(Path.Combine(Infrastructure.Constant.ProgramDirectory, "Images\\close.png"));
imgClose.Source = await App.API.LoadImageAsync(Path.Combine(Constant.ProgramDirectory, "Images\\close.png"));
}
void imgClose_MouseUp(object sender, MouseButtonEventArgs e)
@ -71,11 +71,11 @@ namespace Flow.Launcher
if (!File.Exists(iconPath))
{
imgIco.Source = await ImageLoader.LoadAsync(Path.Combine(Constant.ProgramDirectory, "Images\\app.png"));
imgIco.Source = await App.API.LoadImageAsync(Path.Combine(Constant.ProgramDirectory, "Images\\app.png"));
}
else
{
imgIco.Source = await ImageLoader.LoadAsync(iconPath);
imgIco.Source = await App.API.LoadImageAsync(iconPath);
}
Show();

View file

@ -1168,7 +1168,7 @@ namespace Flow.Launcher.ViewModel
else if (plugins.Count == 1)
{
PluginIconPath = plugins.Single().Metadata.IcoPath;
PluginIconSource = await ImageLoader.LoadAsync(PluginIconPath);
PluginIconSource = await App.API.LoadImageAsync(PluginIconPath);
SearchIconVisibility = Visibility.Hidden;
}
else

View file

@ -45,7 +45,7 @@ namespace Flow.Launcher.ViewModel
private async Task LoadIconAsync()
{
Image = await ImageLoader.LoadAsync(PluginPair.Metadata.IcoPath);
Image = await App.API.LoadImageAsync(PluginPair.Metadata.IcoPath);
OnPropertyChanged(nameof(Image));
}

View file

@ -199,7 +199,7 @@ namespace Flow.Launcher.ViewModel
}
}
return await ImageLoader.LoadAsync(imagePath, loadFullImage).ConfigureAwait(false);
return await App.API.LoadImageAsync(imagePath, loadFullImage).ConfigureAwait(false);
}
private async Task LoadImageAsync()