avalonia structure refactoring

This commit is contained in:
EugeneTes
2026-04-01 09:34:02 +02:00
parent 1c7a4abd5c
commit 1032a5a28c
24 changed files with 65 additions and 31 deletions

View File

@@ -0,0 +1,17 @@
using System.Globalization;
using Avalonia.Data.Converters;
namespace VisionBuilder.UI.Avalonia.Converters;
public class BoolToVisibilityConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value is true;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

View File

@@ -0,0 +1,23 @@
using System.Globalization;
using Avalonia.Data.Converters;
using OpenCvSharp;
using VisionBuilder.UI.Avalonia.Services;
namespace VisionBuilder.UI.Avalonia.Converters;
public class MatToBitmapConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is Mat mat && !mat.Empty())
{
return ImageConverter.MatToAvaloniaBitmap(mat);
}
return null;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}