我有以下内容:
Window window = Application.Current.Windows.Cast<Window>().SingleOrDefault(x => x.IsActive);
ScatterView main = UIHelper.FindChild<ScatterView>(window, "MainScatterView");
main.Items.Add(type);
//Neither of these work
ScatterViewItem parent = (ScatterViewItem)main.ContainerFromElement(type);
ScatterViewItem parent = UIHelper.FindVisualParent<ScatterViewItem>(type);
文档说:当您添加不是 ScatterViewItem 类型的对象时,ScatterView 控件首先将对象包装在 ScatterViewItem 控件中,然后再将其添加到集合 http://msdn.microsoft.com/en-us/library/microsoft .surface.presentation.controls.scatterviewitem.aspx
如何获得包裹在其中的 scatterviewitem?