You could use the DispatcherTimer like this:
public MainWindow()
{
InitializeComponent();
DispatcherTimer t = new DispatcherTimer();
t.Tick += t_Tick;
t.Interval = new TimeSpan(0, 0, 0, 0, 300);
t.Start();
}
Random r = new Random();
void t_Tick(object sender, EventArgs e)
{
byte[] rnd = new byte[4];
r.NextBytes(rnd);
this.Background = new SolidColorBrush(Color.FromArgb(rnd[0], rnd[1], rnd[2], rnd[3]));
}