Exemplo n.º 1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                if (deviceInfo == null)
                {
                    deviceInfo = DependencyService.Get <IDeviceInfo>();
                    if (deviceInfo != null)
                    {
                        phoneSize = (deviceInfo.GetScreenSize().Width - 60) / 3;
                    }
                }
            }
            catch
            {
            }

            switch (Device.Idiom)
            {
            case TargetIdiom.Tablet:
                return(phoneSize);

            case TargetIdiom.Phone:
                return(phoneSize);

            default:
                return(90);
            }
        }