예제 #1
0
        public MainViewModel(IAppInfo app, IBatteryInfo battery, INetworkInfo network, IHardwareInfo hardware)
        {
            this.App      = app;
            this.Battery  = battery;
            this.Network  = network;
            this.Hardware = hardware;

            this.ClearApp     = new Command(this.AppEvents.Clear);
            this.ClearBattery = new Command(this.BatteryEvents.Clear);
            this.ClearNetwork = new Command(this.NetworkEvents.Clear);
        }
예제 #2
0
 public static Task <PowerStatus> ReadPowerStatus(this IBatteryInfo battery) => battery
 .WhenPowerStatusChanged()
 .Take(1)
 .ToTask();
예제 #3
0
 public static Task <int> ReadPercentage(this IBatteryInfo battery) => battery
 .WhenBatteryPercentageChanged()
 .Take(1)
 .ToTask();