修复一个多选框的bug

This commit is contained in:
艾竹
2022-12-02 08:44:40 +08:00
parent 503b92f40e
commit 1abeefcc66
2 changed files with 11 additions and 8 deletions

View File

@@ -100,6 +100,8 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
{
MultiSelectComboBox control = (MultiSelectComboBox)d;
control.DisplayInControl();
control.SelectNodes();
control.SetText();
}
private static void OnSelectedItemsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -238,13 +240,15 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
StringBuilder displayText = new StringBuilder();
foreach (Node s in _nodeList)
{
if (s.IsSelected == true && s.Object.ToString() == "All")
{
displayText = new StringBuilder();
displayText.Append("All");
break;
}
else if (s.IsSelected == true && s.Object.ToString() != "All")
//不使用ALl来显示
//if (s.IsSelected == true && s.Object.ToString() == "All")
//{
// displayText = new StringBuilder();
// displayText.Append("All");
// break;
//}
//else
if (s.IsSelected == true && s.Object.ToString() != "All")
{
displayText.Append(s.Object);
displayText.Append(',');