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); }
public static Task <PowerStatus> ReadPowerStatus(this IBatteryInfo battery) => battery .WhenPowerStatusChanged() .Take(1) .ToTask();
public static Task <int> ReadPercentage(this IBatteryInfo battery) => battery .WhenBatteryPercentageChanged() .Take(1) .ToTask();