Hide scroll bar when it's unnecessary

I have a scroll bar in my game for the card menu. On smaller screen, the user may need to scroll down the list to see them all but for most screens this is unnecessary. I didn’t see a feature to hide the scroll bar but I figured out a converter to do this using the new Computed Transforms.

I created two Number properties in my view model. One called ScrollHeight for the height of the scroll object and another called ScreenHeight.

I created a converter called “ScrollSizeToOpacityConverter” with the following contents:

floor({Input}/{{StatsViewModel/ScreenHeight}})*100.0

The converter takes an input for the size of the contents and divides by screen height. It will floor to 0 if the the scroll height is less than the screen height and multiplies by 100 for opacity. This should result in either 100 or 0 for opacity.

I then bound the opacity like this:

Here’s the result:

20250617-0154-25.6415306.mp4

You could probably also replace 100 in the converter with the width of your scroll bar and bind to width instead if you prefer to to collapse instead of becoming transparent.

I’m curious if anyone has a cleaner solution?