The sample gallery is not just a visual demo. It is a set of concrete integration patterns for the core and Uno companion APIs.
Shows the high-level surface and how Pretext fits into a custom text layout workflow.
Uses Prepare and Layout to turn width changes into deterministic line counts and section heights.
Uses PrepareWithSegments together with PreparedTextMetrics to calculate tight wrap widths for message bubbles.
Uses repeated aggregate layout to size many independent cards cheaply without materializing every line string.
Uses the core rich-inline helper so code spans, links, and atomic chips share one wrapping flow.
Uses markdown parsing, PrepareRichInline, MeasureRichInlineStats, and exact-height-first virtualization to render only the visible window of a 10k-message chat surface.
Shows why prepared text exists: the same prepared object is reused while widths and placements change.
Combines LayoutNextLine, obstacle carving, and positioned lines to flow text through constrained columns and pullquote regions.
Uses the same prepared paragraphs with different line-fitting strategies so you can compare greedy, hyphenated, and more global approaches.
Demonstrates width sensitivity and why text layout should stay tied to the real measured font rather than assumptions about character counts.
When you open a sample view, ask four questions:
That pattern generalizes better than the exact UI design of the sample. The sample app is intentionally diverse. It demonstrates that the same core APIs can support very different layout styles.
Accordion: derive item height from measured line countsBubbles: compute exact bubble widths without DOM-style shrinkwrapMasonry: pack cards after probing text heightDynamic Layout: react to width changes without reparsing textMarkdown Chat: virtualize a rich block surface from exact predicted heightsJustification Comparison: compare strategies on the same prepared paragraphsEditorial Engine: place pull quotes and body copy around constraintsVariable ASCII: show width-sensitive fitting with different glyph runsRich Text: keep atomic badges and splittable text in one inline flowStart with samples/PretextSamples/MainPage.xaml.cs, then move into Samples/SampleInfrastructure.cs and the individual sample views.