Я пробовал добавить метод к событию IsEnabledChanged
Код: Выделить всё
button.IsEnabledChanged += (sender, e) =>
{
button.Background = brush;
};
Я также пытался установить «ButtonDisabledBackgroundThemeBrush» в коде:
Код: Выделить всё
private void BottomGridButtonClick(object sender, RoutedEventArgs e)
{
Button btn = ((Button)sender);
btn.Resources.Add(new KeyValuePair("ButtonDisabledBackgroundThemeBrush", new SolidColorBrush(Colors.Green)));
btn.Resources["ButtonDisabledBackgroundThemeBrush"] = new SolidColorBrush(Colors.Green);
((Button)sender).IsEnabled = false;
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... background
Мобильная версия