private void Init() { _gpio = new Gpio(); bool initResult = _gpio.Initialize(); if (!initResult) { error.Visibility = Visibility.Visible; mode_btn.IsEnabled = false; out_btn.IsEnabled = false; } else { _gpio.InitSuperIO(); chip_type.Content = _gpio.GetChipName(); _gpio.InitGpioReg(); InitGpioModeAndVal(); _gpio.ExitSuperIo(); AddTextChangeEvent(); chip_type.Visibility = Visibility.Visible; chip_name.Visibility = Visibility.Visible; } }