mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
23 lines
638 B
C#
23 lines
638 B
C#
using System;
|
|
using System.Globalization;
|
|
using Avalonia.Data.Converters;
|
|
|
|
namespace Artemis.UI.Shared.Converters;
|
|
|
|
/// <summary>
|
|
/// Converts any object to string by calling its ToString implementation, seems Avalonia doesn't do this
|
|
/// </summary>
|
|
public class ToStringConverter : IValueConverter
|
|
{
|
|
/// <inheritdoc />
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
return value?.ToString();
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
return value;
|
|
}
|
|
} |