36 lines
989 B
C#
36 lines
989 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Data;
|
|
using System.Windows.Media;
|
|
|
|
namespace StyletBasicNavigation.Converters
|
|
{
|
|
public class StringToBrushConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
switch (value.ToString())
|
|
{
|
|
case "blue":
|
|
return Brushes.Blue;
|
|
case "green":
|
|
return Brushes.Green;
|
|
case "purple":
|
|
return Brushes.Purple;
|
|
case "red":
|
|
default:
|
|
return Brushes.Red;
|
|
}
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|