Fix some flickering that can occur when a menu is shown

Fixes Xamarin bug 10021