private void LoadListBoxItems() { deviceNameListBoxItem = FindResource("DeviceNameListBoxItem") as ListBoxItemWithTextBox; iOSPortNameListBoxItem = FindResource("iOSPortNameListBoxItem") as ListBoxItemWithTextBox; autoConnectListBoxItem = FindResource("AutoConnectListBoxItem") as ListBoxItemWithCheckBox; securityListBoxItem = FindResource("SecurityListBoxItem") as ListBoxItemWithComboBox; changePinCodeListBoxItem = FindResource("ChangePinCodeListBoxItem") as ListBoxItemWithCheckBox; newPinCodeListBoxItem = FindResource("NewPinCodeListBoxItem") as ListBoxItemWithTextBox; deviceNameListBoxItem.ContentChangedEvent += OnSettingChanged; iOSPortNameListBoxItem.ContentChangedEvent += OnSettingChanged; autoConnectListBoxItem.ContentChangedEvent += OnSettingChanged; securityListBoxItem.ContentChangedEvent += OnSettingChanged; changePinCodeListBoxItem.ContentChangedEvent += OnSettingChanged; changePinCodeListBoxItem.CheckBoxCheckedChangedEvent += OnChangePinCodeCheckedChanged; newPinCodeListBoxItem.ContentChangedEvent += OnSettingChanged; newPinCodeListBoxItem.ControlIsEnabled = false; BluetoothSecurityTypeManager[] bluetoothSecurities; if (starBluetoothManager.DeviceType == StarBluetoothManager.StarDeviceType.StarDeviceTypeDesktopPrinter) { bluetoothSecurities = new BluetoothSecurityTypeManager[] { new BluetoothSecurityTypeManager(StarBluetoothManager.StarBluetoothSecurity.SSP), new BluetoothSecurityTypeManager(StarBluetoothManager.StarBluetoothSecurity.PINCODE) }; } else { // StarDeviceTypePortablePrinter bluetoothSecurities = new BluetoothSecurityTypeManager[] { new BluetoothSecurityTypeManager(StarBluetoothManager.StarBluetoothSecurity.PINCODE), new BluetoothSecurityTypeManager(StarBluetoothManager.StarBluetoothSecurity.DISABLE) }; } securityListBoxItem.BluetoothSecurities = bluetoothSecurities; }
public void OnChangePinCodeCheckedChanged(object sender, EventArgs e) { ListBoxItemWithCheckBox listBoxItemWithCheckBox = (ListBoxItemWithCheckBox)sender; newPinCodeListBoxItem.ControlIsEnabled = listBoxItemWithCheckBox.CheckBoxIsChecked; }