private void BtnAddPacket_OnClick(object sender, RoutedEventArgs e) { ProtocolController.AddPacket(CurrentProtocol); LbPackets.ItemsSource = null; LbPackets.ItemsSource = CurrentProtocol.Packets; if (CurrentProtocol.Packets != null) { LbPackets.SelectedIndex = CurrentProtocol.Packets.Count - 1; } }