using System; using System.Globalization; using Avalonia.Controls; using Avalonia.Data.Converters; namespace Dock.Avalonia.Converters; /// /// Converts WindowState to bool indicating if the window is maximized. /// public class IsMaximizedConverter : IValueConverter { /// /// Gets instance. /// public static IsMaximizedConverter Instance { get; } = new(); /// public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { if (value is WindowState windowState) { return windowState == WindowState.Maximized; } return false; } /// public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { return null; } }