Files
BeWoPlaner/BeWo/Converter/BoolEnabledToTabitemBackgroundConverter.cs

25 lines
782 B
C#

using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace BeWo.Converter
{
public class BoolEnabledToTabitemBackgroundConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return Application.Current.Resources["TabItemTextBrush"];
}
return (bool)value ? Application.Current.Resources["TabItemTextBrush"] : Application.Current.Resources["TabItemTextBrushDisabled"];
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}