This repository was archived by the owner on Oct 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,6 +178,29 @@ void CreateSurface(PlacementOperation operation)
178178 }
179179 }
180180
181+ private IEnumerable < DesignItem > AllDesignItems ( DesignItem designItem = null )
182+ {
183+ if ( designItem == null )
184+ {
185+ designItem = this . ExtendedItem . Services . DesignPanel . Context . RootItem ;
186+ yield return designItem ;
187+ yield return designItem . ContentProperty . Value ;
188+ designItem = designItem . ContentProperty . Value ;
189+ }
190+ //yield return designItem.ContentProperty.Value;
191+
192+ if ( designItem . ContentProperty . IsCollection )
193+ foreach ( var collectionElement in designItem . ContentProperty . CollectionElements )
194+ {
195+ yield return collectionElement ;
196+
197+ foreach ( var el in AllDesignItems ( collectionElement ) )
198+ {
199+ yield return el ;
200+ }
201+ }
202+ }
203+
181204 void BuildMaps ( PlacementOperation operation )
182205 {
183206 horizontalMap = new List < Snapline > ( ) ;
@@ -188,7 +211,7 @@ void BuildMaps(PlacementOperation operation)
188211
189212 AddLines ( containerRect , 0 , false ) ;
190213
191- foreach ( var item in ExtendedItem . ContentProperty . CollectionElements
214+ foreach ( var item in AllDesignItems ( ) /* ExtendedItem.ContentProperty.CollectionElements */
192215 . Except ( operation . PlacedItems . Select ( f => f . Item ) ) )
193216 {
194217 var bounds = GetPosition ( operation , item ) ;
You can’t perform that action at this time.
0 commit comments