Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static bool IsLandscape(this DeviceOrientation value) => !value.IsPortrait();