Files
Libation/Source/LibationAvalonia/ViewModels/MainVM._NoUI.cs
T
Cursor Agentandrmcrackan dcaa42d21d Draw Avalonia Liberate icons from the shared generator
Replace the hand-composed vector layers with the shared rendering bound through
EntryStatus.ButtonImage, and delete the geometry and stoplight brushes that only
that composition used.

The rendering is per-theme rather than a set of DynamicResource brushes, so each
button re-renders its icon when the actual theme variant changes.

Co-authored-by: rmcrackan <rmcrackan@gmail.com>
2026-08-13 05:56:29 +00:00

29 lines
983 B
C#

using Avalonia.Styling;
using LibationFileManager;
using LibationUiBase;
using System.IO;
namespace LibationAvalonia.ViewModels;
partial class MainVM
{
public static void Configure_NonUI()
{
using var ms1 = new MemoryStream();
App.OpenAsset("img-coverart-prod-unavailable_80x80.jpg").CopyTo(ms1);
PictureStorage.SetDefaultImage(PictureSize._80x80, ms1.ToArray());
using var ms2 = new MemoryStream();
App.OpenAsset("img-coverart-prod-unavailable_300x300.jpg").CopyTo(ms2);
PictureStorage.SetDefaultImage(PictureSize._300x300, ms2.ToArray());
using var ms3 = new MemoryStream();
App.OpenAsset("img-coverart-prod-unavailable_500x500.jpg").CopyTo(ms3);
PictureStorage.SetDefaultImage(PictureSize._500x500, ms3.ToArray());
PictureStorage.SetDefaultImage(PictureSize.Native, ms3.ToArray());
BaseUtil.SetLoadImageDelegate(AvaloniaUtils.TryLoadImageOrDefault);
BaseUtil.SetIsDarkModeDelegate(() => App.Current.ActualThemeVariant == ThemeVariant.Dark);
}
}