Answer the question
In order to leave comments, you need to log in
Grid resources not working. What to do?
I created several classes with my own methods, but I can't connect them. Here is my code:
using System;
using System.Globalization;
using System.Windows.Data;
namespace WeirdShit
{
public class Bool2String : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool what = (bool)value;
if (what)
return Properties.Settings.Default.FilledHeart;
else
return Properties.Settings.Default.EmptyHeart;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value.ToString().Contains(Properties.Settings.Default.EmptyHeart))
return value;
else
return true;
}
}
<Grid.Resources>
<local:Bool2String x:Key="star"></local:Bool2String>
</Grid.Resources>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question