Update CheckComboBox.cs

This commit is contained in:
NaBian committed 2021-02-03 21:54:33 +08:00
1 parent 4f94e23789
commit 2b1973fd1c
1 file changed
+10 -1
@@ -239,6 +239,7 @@ namespace HandyControl.Controls
}
_panel.Children.Clear();
var dataContext = DataContext;
foreach (var item in SelectedItems)
{
@@ -250,7 +251,15 @@ namespace HandyControl.Controls
Tag = checkComboBoxItem
};
tag.SetBinding(ContentControl.ContentProperty, new Binding(DisplayMemberPath) { Source = item });
if (dataContext != null)
{
tag.SetBinding(ContentControl.ContentProperty, new Binding(DisplayMemberPath) { Source = item });
}
else
{
tag.Content = checkComboBoxItem.Content;
}
_panel.Children.Add(tag);
}
}