50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
using Sarand.Net.Standard.Base.App;
|
|
using Sarand.Net.Standard.Base.Core;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Xamarin.Essentials;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Sarand.Net.Standard.Mobile.App
|
|
{
|
|
//=======================================================================
|
|
public abstract class SaxApplication : Application
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Definitions.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
protected SaxApplication ()
|
|
{
|
|
// Xamarin Essentials version tracking.
|
|
VersionTracking.Track();
|
|
|
|
// Log environment.
|
|
SaLogger.Debug("AppInfo.AppName: " + AppInfo.Name);
|
|
SaLogger.Debug("AppInfo.PackageName: " + AppInfo.PackageName);
|
|
SaLogger.Debug("AppInfo.Version: " + AppInfo.VersionString);
|
|
SaLogger.Debug("AppInfo.Build: " + AppInfo.BuildString);
|
|
SaLogger.Debug("DeviceWidth: " + DeviceWidth);
|
|
SaLogger.Debug("DeviceHeight: " + DeviceHeight);
|
|
SaLogger.Debug("DeviceDensity: " + DeviceDisplay.MainDisplayInfo.Density);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
// Device screen size and orientation.
|
|
public static bool Landscape => DeviceWidth > DeviceHeight;
|
|
public static double DeviceWidth => DeviceDisplay.MainDisplayInfo.Width;
|
|
public static double DeviceHeight => DeviceDisplay.MainDisplayInfo.Height;
|
|
public static double MinDeviceDimension => Math.Min(DeviceWidth, DeviceHeight);
|
|
public static double MaxDeviceDimension => Math.Max(DeviceWidth, DeviceHeight);
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|