public object ParseStaticResource (ref string expression)
{
if (!expression.EndsWith ("}"))
throw new Exception ("Whitespace is not allowed after the end of the expression");
char next;
string name = GetNextPiece (ref expression, out next);
object o = LookupNamedResource (null, name);
#if !__TESTING
if (o == null)
o = Application.Current.Resources [name];
#endif
return o;
}