private static VisualTheme GetBasicWindowVisualTheme(IWin32Window w = null) { var theme = new VisualTheme(BasicClassListValue); if (w != null) { theme.GetType().GetField("hTheme", BindingFlags.Instance | BindingFlags.NonPublic) ?.SetValue(theme, LoadBasicThemeData(w)); } return(theme); }
public static UxTheme.SafeThemeHandle GetTheme(this VisualTheme th) { return(th.GetType().GetField("hTheme", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(th) as UxTheme.SafeThemeHandle); }