When I create a new ScrollViewer, I need to modify the size of the ScrollBars in the ScrollViewer (change the VerticalScroll width and the HorizontalScroll height), programatically.
I tried the following based in a solution found in SO, without success:
public static ScrollViewer CreateScrollViewer()
{
ScrollViewer result = new ScrollViewer();
// I need to set the scroll width and height here
// I tried the following with no success
result.Resources.Add(SystemParameters.VerticalScrollBarWidth, 100);
return result;
}
I saw some solutions to change them, but all are XAML based. I need to do it in runtime, in pure C#. How could I do this?