private void ResetPin_ValueChanged(object sender, GPinEventArgs e) { Dispatcher.RunAsync(() => { if (e.Edge == GpioPinEdge.FallingEdge) { if (Pins.All(x => !x.Value)) { foreach (var pin in Pins) { pin.Value = true; } } else { foreach (var pin in Pins) { pin.Reset(); } } } else { } }); }