I am attempting to work out the algorithm associated with sizing of the WPF Scrollbar thumb element.
The thumb element can be sized using the Scrollbar.ViewportSi
Scrollbar thumb size for UWP:
static void SetViewportSize(ScrollBar bar, double size)
{
var max = (bar.Maximum - bar.Minimum);
bar.ViewportSize = size / (max - size) * max;
bar.IsEnabled = (bar.ViewportSize >= 0 &&
bar.ViewportSize != double.PositiveInfinity);
InvalidateScrollBar(bar);
}
static void InvalidateScrollBar(ScrollBar bar)
{
var v = bar.Value;
bar.Value = (bar.Value == bar.Maximum) ? bar.Minimum : bar.Maximum;
bar.Value = v;
}