public virtual bool ShouldShowToolbarButton() { if (Device.Idiom == TargetIdiom.Phone) { return(true); } FlyoutLayoutBehavior behavior = FlyoutLayoutBehavior; DeviceOrientation orientation = Device.Info.CurrentOrientation; bool isSplitOnLandscape = (behavior == FlyoutLayoutBehavior.SplitOnLandscape || behavior == FlyoutLayoutBehavior.Default) && orientation.IsLandscape(); bool isSplitOnPortrait = behavior == FlyoutLayoutBehavior.SplitOnPortrait && orientation.IsPortrait(); return(behavior != FlyoutLayoutBehavior.Split && !isSplitOnLandscape && !isSplitOnPortrait); }
public static bool IsLandscape(this DeviceOrientation value) => !value.IsPortrait();