private static void ClearViewPropertyValues(ViewBase view) { if (view == null) { throw new ArgumentNullException("view"); } DependencyProperty dp; foreach (FieldInfo fieldInfo in view.GetType().GetFields(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Static)) { dp = fieldInfo.GetValue(view) as DependencyProperty; if (dp != null) { view.ClearValue(dp); } } }