Tag: 框列表框

Listbox IsSynchronizedWithCurrentItem导致选择第一个项目,即使它没有告诉它这样做

我遇到了一些可能是wpf列表框中的错误的东西。 请查看代码然后我解释会发生什么 窗口 用户控制 select all 用户控制背后的代码 public partial class MultiSelectionComboBox : ComboBox { #region fields, dependencies, command and constructor private ListBox listBox; private ItemsControl itemsControl; private CheckBox checkBox; public static readonly DependencyProperty ASLSelectedItemsProperty = DependencyProperty.Register(“ASLSelectedItems”, typeof(ObservableCollection), typeof(MultiSelectionComboBox), new PropertyMetadata(null)); public static readonly DependencyProperty ASLDisplayMemberPathProperty = DependencyProperty.Register(“ASLDisplayMemberPath”, typeof(string), typeof(MultiSelectionComboBox), new PropertyMetadata(“Description”)); public MultiSelectionComboBox() { InitializeComponent(); […]