Table of Contents

Namespace McServerLauncher.Behaviors

Classes

AutoScrollBehavior

Attached property that makes a ListBox auto-scroll to the end when items are added (useful for the real-time console).

MarkdownBody

Attached property that renders a project's long description (Markdown, as Modrinth returns it) into a panel, in the same spirit as MinecraftMotd: the view model hands over text, the view turns it into controls.

Parsing lives in MarkdownParser; this only decides how each block looks. Links become clickable text that opens the browser through BrowserLauncher, which refuses anything that isn't an ordinary web address — the description is remote content.

MinecraftMotd

Attached property that renders a Minecraft MOTD (with § color/format codes) as colored text inside a TextBlock, just like it looks in the game's server list.

ResetScrollBehavior

Attached property that sends a list back to the top when its contents are replaced, and leaves it alone when items are merely appended.

The distinction is the point. Changing a filter or the search produces a *different* set of results, where the position the user was at means nothing — the twentieth optimisation mod has no relation to the twentieth magic mod — so the list starts at the top. "Load more" produces the *same* set with more at the end, so the position must survive; anything else would throw the user back to the start of a list they were halfway through reading.

The view model already draws that line: it swaps the collection in one go (a Reset) for a new set and appends (an Add) for more of the same. This just follows it, which is why no extra state is needed on either side.