here is my code
public bool DisplayError1
{
get { return _displayError1; }
set
{
if (value.Equals(_displayError1)) return;
_displayError1 = value;
NotifyPropertyChanged();
}
}
private bool _displayError2 = false;
public bool DisplayError2
{
get { return _displayError2; }
set
{
if (value.Equals(_displayError2)) return;
_displayError2 = value;
NotifyPropertyChanged();
}
}
private bool _displayError3 = false;
public bool DisplayError3
{
get { return _displayError3; }
set
{
if (value.Equals(_displayError3)) return;
_displayError3 = value;
NotifyPropertyChanged();
}
}
private bool _displayError4 = false;
public bool DisplayError4
{
get { return _displayError4; }
set
{
if (value.Equals(_displayError4)) return;
_displayError4 = value;
NotifyPropertyChanged();
}
}
these are set of my properties. I need to convert this property into a method in order to get the exact one I need
as an example
void display(string property){}
then I need to get that exact propety in the main method
display(displayerror)
how to do this
I implement this code
public bool DisplayRightOne(bool display)
{
bool[] array = new bool[] {DisplayError,DisplayError1,DisplayError2,DisplayError3,DisplayError4,DisplayError5,DisplayError6,DisplayError7,DisplayError8 };
int i;
for( i=0;i<array.Length; i++)
{
if (display == array[i])
{
return array[i] = true;
}
}
return true;}
I access this method
DisplayRightOne(DisplayError);
but did not make DisplayError property true.where is the problem pls give me suggestion