I have to set the grid background based on the result. that is working fine.
But when I am clicking again the button, it is not set to white color.
- private void Conversion_Click(object sender, RoutedEventArgs e)
- {
- grid.Background = new SolidColorBrush(Colors.White);
- bool result = DoConversion();
-
- if (result)
- {
- grid.Background = new SolidColorBrush(Colors.Green);
- }
- else
- {
- grid.Background = new SolidColorBrush(Colors.Red);
- }
- }