Files
ThreadPilot/Converters/BoolToStringConverter.cs
T
Prime Build 9bab8ee8f9 Add performance and system tweaks features
Introduced new services and view models for performance monitoring and system tweaks, including corresponding views. Added converters and updated main application files to integrate these features. Refactored service configuration and improved application structure to support new functionality.
2025-07-30 01:50:57 +02:00

32 lines
934 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
namespace ThreadPilot.Converters
{
/// <summary>
/// Converts boolean values to strings based on parameter format
/// </summary>
public class BoolToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool boolValue && parameter is string paramString)
{
var parts = paramString.Split('|');
if (parts.Length == 2)
{
return boolValue ? parts[0] : parts[1];
}
}
return value?.ToString() ?? string.Empty;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}