SolidColorBrush
is a dependency object - and you're creating it in the non-UI thread, then trying to use it in the UI thread. Try this instead:
Action action = () =>
{
SolidColorBrush scb = new SolidColorBrush(Color.FromRgb(21, 21, 21));
Background.Background = scb;
};
Dispatcher.BeginInvoke(action);
Or of course just in one statement:
Dispatcher.BeginInvoke((Action (() =>
Background.Background = new SolidColorBrush(Color.FromRgb(21, 21, 21)))));
Either way, you're creating the SolidColorBrush
in the action that you're passing to the dispatcher.