修复标签输入框BUG

解决控件在VM绑定是照成的newTags和oldTags空值以及下标越界问题
This commit is contained in:
Coolkeke
2023-12-16 04:52:06 +08:00
parent 80fc6ffa7b
commit 11ec9e3ede

View File

@@ -143,10 +143,12 @@ public class TagInput : TemplatedControl
{ {
Items.RemoveAt(Items.Count - 1); Items.RemoveAt(Items.Count - 1);
} }
if (newTags != null)
for (int i = 0; i < newTags.Count; i++)
{ {
Items.Insert(Items.Count - 1, newTags[i]); for (int i = 0; i < newTags.Count; i++)
{
Items.Add(newTags[i]);
}
} }
if (oldTags is INotifyCollectionChanged inccold) if (oldTags is INotifyCollectionChanged inccold)