You are changing an element within an array. That will not raise any "property changed" events, so the UI has no idea that the binding needs to be updated.
Try replacing your array with an
ObservableCollection<>
:
public ObservableCollection<SolidColorBrush> btnBrush { get; } = CreateBrushes();
private static ObservableCollection<SolidColorBrush> CreateBrushes()
{
Color color = Color.FromRgb(0xEE, 0xD6, 0xC4);
SolidColorBrush brush = new SolidColorBrush(color);
IEnumerable<SolidColorBrush> brushes = Enumerable.Repeat(brush, 100);
return new ObservableCollection<SolidColorBrush>(brushes);
}
public void LeftClick(int id_no)
{
btnBrush[id_no] = new SolidColorBrush(Color.FromRgb(0xB3, 0x54, 0x1E));
}
ObservableCollection<T> Class (System.Collections.ObjectModel) | Microsoft Docs[
^]