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); }
static void OnScreenMetricsChanaged(ScreenMetrics metrics) => OnScreenMetricsChanaged(new ScreenMetricsChanagedEventArgs(metrics));
public ScreenMetricsChanagedEventArgs(ScreenMetrics metrics) { Metrics = metrics; }