You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
677 B
28 lines
677 B
1 year ago
|
using AsyncAwaitBestPractices;
|
||
|
using Avalonia.Controls.Primitives;
|
||
|
using Avalonia.Interactivity;
|
||
|
using Avalonia.Threading;
|
||
|
using StabilityMatrix.Avalonia.ViewModels.Base;
|
||
|
|
||
|
namespace StabilityMatrix.Avalonia.Controls;
|
||
|
|
||
|
public class ImageFolderCard : TemplatedControl
|
||
|
{
|
||
|
/// <inheritdoc />
|
||
|
protected override void OnLoaded(RoutedEventArgs e)
|
||
|
{
|
||
|
base.OnLoaded(e);
|
||
|
|
||
|
if (DataContext is ViewModelBase vm)
|
||
|
{
|
||
|
vm.OnLoaded();
|
||
|
Dispatcher.UIThread
|
||
|
.InvokeAsync(async () =>
|
||
|
{
|
||
|
await vm.OnLoadedAsync();
|
||
|
})
|
||
|
.SafeFireAndForget();
|
||
|
}
|
||
|
}
|
||
|
}
|