我正在开发一个自定义控件,它包含一组项。向收藏中添加物品时,您需要执行以下操作:
myCustomControl.BeginAddItems();
myCustomControl.Items.Add("a");
myCustomControl.Items.Add("b");
myCustomControl.Items.Add("c");
myCustomControl.EndAddItems();
如果在XAML中定义,它将是:
<MyControl>
<Items>
<Item Name="a" />
<Item Name="b" />
<Item Name="c" />
</Items>
</MyControl>
我怎么能
EndAddItems
从XAML加载时调用(最好是BeginAddItems)?有什么办法吗
MyControl
XAML是否可以通知它已完成加载?