Files
modernkeepass/ModernKeePass10/Converters/DiscreteIntToSolidColorBrushConverter.cs
Geoffroy BONNEVILLE 56d93a5187 Moved application code to the Application layer
Imported Win10 project
Code cleanup
WIP - Use common UWP services for Win8.1 and Win10
2020-04-06 20:20:45 +02:00

28 lines
879 B
C#

using System;
using Windows.UI;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;
namespace ModernKeePass.Converters
{
public class DiscreteIntToSolidColorBrushConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var status = System.Convert.ToInt32(value);
switch (status)
{
case 1: return new SolidColorBrush(Colors.Red);
case 3: return new SolidColorBrush(Colors.Yellow);
case 5: return new SolidColorBrush(Colors.Green);
default: return new SolidColorBrush(Colors.Black);
}
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}