Dodaj pliki projektów.
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Haftmittel
|
||||
{
|
||||
[ValueConversion(typeof(Brushes), typeof(bool))]
|
||||
class ClassKonwerterNaKolory : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value is bool)
|
||||
{
|
||||
if ((bool)value)
|
||||
{
|
||||
return Brushes.Red;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Brushes.White;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Brushes.White;
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value is Brushes)
|
||||
{
|
||||
if ((value as Brush) == Brushes.Red)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user