Fix styles as Styles (not ResourceDictionary); replace DataTriggers with width converters; add IsZeroConverter; remove unsupported properties; fix ancestor command bindings; bind SplitView props directly.

This commit is contained in:
Codex CLI 2025-08-27 03:23:40 -05:00
commit 1667fc8b3d
9 changed files with 146 additions and 101 deletions

View file

@ -0,0 +1,29 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
namespace AdvancedCalculator.Converters;
public class WidthToPaneOpenConverter : IValueConverter
{
public static readonly WidthToPaneOpenConverter Instance = new();
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo? culture)
{
if (value is double width)
{
double threshold = 640;
if (parameter is double p)
threshold = p;
else if (parameter is string s && double.TryParse(s, NumberStyles.Number, CultureInfo.InvariantCulture, out var parsed))
threshold = parsed;
return width >= threshold;
}
return true;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo? culture)
=> throw new NotSupportedException();
}