Also this previous solution was completely broken. It was not possible to actually switch between the preference panes when using a custom view :-/