public ReadOnlyObservableCollection<Element> Elements {get;}
Public ReadOnly Property Elements As ReadOnlyObservableCollection(Of Element)
public ReadOnlyObservableCollection<Element> Elements {get;}
Public ReadOnly Property Elements As ReadOnlyObservableCollection(Of Element)
//Find an element on a layout. // Reference a layout project item by name LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals("MyLayout")); if (layoutItem != null) { QueuedTask.Run(() => { // Reference and load the layout associated with the layout item Layout mylayout = layoutItem.GetLayout(); if (mylayout != null) { //Find a single specific element Element rect = mylayout.FindElement("Rectangle") as Element; //Or use the Elements collection Element rect2 = mylayout.Elements.FirstOrDefault(item => item.Name.Equals("Rectangle")); } }); }
Target Platforms: Windows 11, Windows 10