/// <summary>
        /// Initializes a new instance of the <see cref="Xamarin.Forms.Labs.WindowsPhoneDevice" /> class.
        /// </summary>
        private WindowsPhoneDevice()
        {
            Display = new Display();
            PhoneService = new PhoneService();
            Battery = new Battery();

            if (Microsoft.Devices.Sensors.Accelerometer.IsSupported)
            {
                Accelerometer = new Accelerometer();
            }

            if (Microsoft.Devices.Sensors.Gyroscope.IsSupported)
            {
                this.Gyroscope = new Gyroscope();
            }

            MediaPicker = new MediaPicker();
        }
        /// <summary>
        /// Prevents a default instance of the <see cref="WindowsPhoneDevice"/> class from being created.
        /// </summary>
        private WindowsPhoneDevice()
        {
            Display = new Display();
            PhoneService = new PhoneService();
            Battery = new Battery();

            if (DeviceCapabilities.IsEnabled(DeviceCapabilities.Capability.ID_CAP_SENSORS))
            {
                if (Microsoft.Devices.Sensors.Accelerometer.IsSupported)
                {
                    this.Accelerometer = new Accelerometer();
                }

                if (Microsoft.Devices.Sensors.Gyroscope.IsSupported)
                {
                    this.Gyroscope = new Gyroscope();
                }
            }

            //if (DeviceCapabilities.IsEnabled(DeviceCapabilities.Capability.ID_CAP_MEDIALIB_PHOTO))
            //{
            //    MediaPicker = new MediaPicker();
            //}
        }
예제 #3
0
 public ChargerMonitor (Battery battery)
 {
     this.battery = battery;
 }
예제 #4
0
 public LevelMonitor (Battery battery)
 {
     this.battery = battery;
 }
예제 #5
0
 public ChargerMonitor(Battery battery)
 {
     this.battery = battery;
 }
예제 #6
0
 public LevelMonitor(Battery battery)
 {
     this.battery = battery;
 }