if (buttonTextBoxMap.TryGetValue(currentButton, out TextBox currentTextbox))
{
string currentText = new string(currentTextbox.Text.OrderBy(c => c).ToArray());
foreach (TextBox textBox in textBoxes)
{
if (textBox != currentTextbox) // Provjerite da li je trenutni TextBox isti kao currentTextbox
{
string textBoxText = new string(textBox.Text.OrderBy(c => c).ToArray());
if (textBoxText == currentText)
{
currentTextbox.Background = new SolidColorBrush(Color.FromArgb(76, 255, 0, 0));
}/*
else if (textBoxText != currentText)
{
currentTextbox.Background = new SolidColorBrush(Color.FromArgb(76, 0, 0, 0));
}*/ //<----------- THE PROBLEM IS THIS ELSE IF
}
}
}
if (buttonTextBoxMap.TryGetValue(currentButton, out TextBox currentTextbox))
{
string currentText = new string(currentTextbox.Text.OrderBy(c => c).ToArray());
foreach (TextBox textBox in textBoxes)
{
if (textBox != currentTextbox) // Provjerite da li je trenutni TextBox isti kao currentTextbox
{
string textBoxText = new string(textBox.Text.OrderBy(c => c).ToArray());
if (textBoxText == currentText)
{
currentTextbox.Background = new SolidColorBrush(Color.FromArgb(76, 255, 0, 0));
}/*
else if (textBoxText != currentText)
{
currentTextbox.Background = new SolidColorBrush(Color.FromArgb(76, 0, 0, 0));
}*/ //<----------- THE PROBLEM IS THIS ELSE IF
}
}
}