List<IDropArea> _dropAreas = null;
IEnumerable<IDropArea> IOverlayWindowHost.GetDropAreas(LayoutFloatingWindowControl draggingWindow)
{
if (_dropAreas != null)
return _dropAreas;
_dropAreas = new List<IDropArea>();
if (draggingWindow.Model is LayoutDocumentFloatingWindow)
return _dropAreas;
//你让我好找 !!!
if (draggingWindow.Model is LayoutAnchorableFloatingWindow)
return _dropAreas;
var rootVisual = (Content as FloatingWindowContentHost).RootVisual;
foreach (var areaHost in rootVisual.FindVisualChildren<LayoutAnchorablePaneControl>())
{
_dropAreas.Add(new DropArea<LayoutAnchorablePaneControl>(
areaHost,
DropAreaType.AnchorablePane));
}
foreach (var areaHost in rootVisual.FindVisualChildren<LayoutDocumentPaneControl>())
{
_dropAreas.Add(new DropArea<LayoutDocumentPaneControl>(
areaHost,
DropAreaType.DocumentPane));
}
return _dropAreas;
}