private void ChangeSelectionIndex_ButtonClick(object sender, RoutedEventArgs e)
        {
            var btn = (Button)sender;

            ModbusAddresses.SelectedIndex = int.Parse(
                btn.Content.ToString()
                .Substring(0,
                           btn.Content.ToString().IndexOf("-", StringComparison.Ordinal)));
            ModbusAddresses.ScrollIntoView(ModbusAddresses.SelectedItem);
        }
        private void TxtSearchAddress_TextChanged(object sender, TextChangedEventArgs e)
        {
            var index       = 0;
            var searchField =
                ((ComboBoxItem)CboSearchField.Items[CboSearchField.SelectedIndex]).Content.ToString();

            foreach (var modBus in this.ModbusAddressControl)
            {
                if (searchField == "Modbus Address")
                {
                    if (modBus.ModBusAddress.ToLower().StartsWith(TxtSearchAddress.Text.ToLower()))
                    {
                        ModbusAddresses.SelectedIndex = index;
                        ModbusAddresses.ScrollIntoView(ModbusAddresses.SelectedItem);
                        break;
                    }
                }
                else if (searchField == "Nickname")
                {
                    if (modBus.Nickname.ToLower().StartsWith(TxtSearchAddress.Text.ToLower()))
                    {
                        ModbusAddresses.SelectedIndex = index;
                        ModbusAddresses.ScrollIntoView(ModbusAddresses.SelectedItem);
                        break;
                    }
                }
                else
                {
                    if (modBus.Comments.ToLower().StartsWith(TxtSearchAddress.Text.ToLower()))
                    {
                        ModbusAddresses.SelectedIndex = index;
                        ModbusAddresses.ScrollIntoView(ModbusAddresses.SelectedItem);
                        break;
                    }
                }

                index++;
            }
        }