public static string GetPageCategory(this SamplePage self) { var attr = self.GetType().GetTypeInfo().GetCustomAttribute(typeof(SamplePageAttribute)) as SamplePageAttribute; if (attr != null) { return(attr.Category); } return(string.Empty); }
public static string GetPageCategory(this SamplePage self) { if (self == null) { throw new ArgumentNullException("self"); } var attr = self.GetType().GetTypeInfo().GetCustomAttribute(typeof(SamplePageAttribute)) as SamplePageAttribute; if (attr != null) { return(attr.Category); } return(string.Empty); }
public static Brush GetCategoryBackground(this SamplePage self) { string category = self.GetPageCategory(); return(self.GetCategoryBackground(category)); }