0

I have a scrollable control whose content sometimes requires the scrollbars to be operational depending on what display the user is using to see the View. So, for example, if the View is being displayed on a laptop screen it will most likely have scroll bars in operation. Whereas, on a 27" monitor all will be visible with no scrollbars present.

What I would like to be able to do is calculate a scale factor that I can use in a ScaleTransform on the ScrollableControl so that the contents are completely visible on screen (what ever that screen happens to be). But I don't know how to do this?

I am aware that I could simply wrap the ScrollableControl with a ViewBox, but my users want to be able to vary the scale factor, so I am using a slider and a ScaleTranform to give them this effect. However, I would like to initialise the slider with the ScaleFactor that I am seeking help with so the View starts off with everything on screen.

I have discovered the System Parameters type which looks to have some useful screen dimension properties, but I'm still confused about how to apply them to work out the scale factor.

halfer
  • 19,824
  • 17
  • 99
  • 186
Cleve
  • 1,273
  • 1
  • 13
  • 26
  • Let `ViewBox` to scale content and then simply [retrive the scale factor](https://stackoverflow.com/q/5423334/1997232). – Sinatr Sep 14 '18 at 13:45
  • @Sinatr, thanks for your reply. I'm at a loss to see how I can have a ViewBox in operation to get the scale factor and my slider and the ScaleTransform also altering the display. – Cleve Sep 14 '18 at 13:56

0 Answers0