|
Window Framework for UI Toolkit v2.0.x
|
Visual-tree ancestor lookup and sample placeholder construction utilities. More...
Static Public Member Functions | |
| static VisualElement | GetDocumentRoot (this VisualElement ele) |
| Walks up the VisualTree to find the top most VisualElement of the panel that the given element belongs to. | |
| static VisualElement | SlotSimulator (int slotCount) |
| Creates a container with a given number of 'Slots' to simulate a grid layout. | |
Visual-tree ancestor lookup and sample placeholder construction utilities.
These helpers do not establish controller ownership, persistence or inventory logic.
|
inlinestatic |
Walks up the VisualTree to find the top most VisualElement of the panel that the given element belongs to.
| ele | The Visual Element to use as a stating point |
| ArgumentNullException | Thrown if the given element is null |
// Get the root element of the panel that contains the given element
Returns the topmost current ancestor even for a detached subtree. It does not query UIDocument ownership or guarantee the controller's managed window root. Use the configured controller root for managed window hosting, not this utility's result blindly.
|
inlinestatic |
Creates a container with a given number of 'Slots' to simulate a grid layout.
| slotCount | Number of 'Slots' to create in the grid |
// Create a container with 10 slots to simulate a 5x5 grid layout
Creates slotCount empty 50-by-50 placeholder elements with inline gray/white styling in a wrapping row. This is a visual demonstrator, not an inventory/grid data API, fixed column count, theme-tokenized production control or interaction implementation. Zero/negative counts produce an empty container. No item data or resources are loaded.
