I have a class Shoes with a bool property to check if shoes are secondhand or not.
class Shoes
{
private bool secondhand;
public bool IsSecondHand
{
get { return secondhand; }
set
{
if (value == ) //don't know what to use here
{
value = false;
}
else
{
//is true
}
}
}
}
My intention is to use this class (separate file) with a WPF window and using a checkbox that when checked makes my bool true, otherwise is false. I need to preserve the format get {} set {}. The problem is that this proprety should "work" even without the WPF part.
value? , it looks like you are trying to set value tofalsein true case of your if statement and true otherwise.? is that the case ?