28 lines
751 B
C#
28 lines
751 B
C#
using System.IO;
|
|
using System.Windows.Media;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using Livia.Models.Data;
|
|
using Livia.Utility;
|
|
|
|
namespace Livia.ViewModels
|
|
{
|
|
public class SimpleImageViewModel : ObservableObject, ILiviaModuleViewModel
|
|
{
|
|
public ImageSource? BitmapImage { get => _bitmapImage; private set => SetProperty(ref _bitmapImage, value); }
|
|
public string LoadPath { get; set; } = string.Empty;
|
|
|
|
|
|
private ImageSource? _bitmapImage;
|
|
|
|
public async Task LoadData(DataBlock dataBlock)
|
|
{
|
|
string file = Path.Combine(dataBlock.ResultPath, LoadPath);
|
|
BitmapImage = await LiviaUtility.LoadBitmapAsync(file);
|
|
}
|
|
|
|
public void Init()
|
|
{
|
|
}
|
|
}
|
|
}
|