ResourceDictionary rd = new ResourceDictionary();
rd.Add(new ComponentResourceKey(typeof(MyType), "brush1"),
       new SolidColorBrush(Colors.Red));
rd.Add(new ComponentResourceKey(typeof(MyType), "brush2"),
       new SolidColorBrush(Colors.Green));

