示例#1
0
        static ScreenMetrics GetScreenMetrics()
        {
            var metrics = new ScreenMetrics();

            var displayMetrics = CaboodlePlatform.CurrentContext.Resources?.DisplayMetrics;

            if (displayMetrics != null)
            {
                metrics.Width   = displayMetrics.WidthPixels;
                metrics.Height  = displayMetrics.HeightPixels;
                metrics.Density = displayMetrics.Density;
            }

            metrics.Orientation = CalculateOrientation();
            metrics.Rotation    = CalculateRotation();

            return(metrics);
        }
示例#2
0
 static void OnScreenMetricsChanaged(ScreenMetrics metrics)
 => OnScreenMetricsChanaged(new ScreenMetricsChanagedEventArgs(metrics));
示例#3
0
 public ScreenMetricsChanagedEventArgs(ScreenMetrics metrics)
 {
     Metrics = metrics;
 }