Add Windows desktop version
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace StreamPlayer.Desktop.Converters;
|
||||
|
||||
public sealed class BooleanToBrushConverter : IValueConverter
|
||||
{
|
||||
public IBrush TrueBrush { get; set; } = Brushes.White;
|
||||
public IBrush FalseBrush { get; set; } = Brushes.Gray;
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value is bool boolean)
|
||||
{
|
||||
return boolean ? TrueBrush : FalseBrush;
|
||||
}
|
||||
return Avalonia.AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, System.Globalization.CultureInfo culture) =>
|
||||
Avalonia.AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
Reference in New Issue
Block a user