Class ResetScrollBehavior
- Namespace
- McServerLauncher.Behaviors
- Assembly
- McServerLauncher.dll
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.
public static class ResetScrollBehavior
- Inheritance
-
ResetScrollBehavior
- Inherited Members
Fields
ResetOnResetProperty
public static readonly AttachedProperty<bool> ResetOnResetProperty
Field Value
- AttachedProperty<bool>
Methods
GetResetOnReset(ListBox)
public static bool GetResetOnReset(ListBox o)
Parameters
oListBox
Returns
SetResetOnReset(ListBox, bool)
public static void SetResetOnReset(ListBox o, bool value)
Parameters
oListBoxvaluebool