UnitTypeId of shared parameter

Hi there

I am looking to get UnitTypeId and StorageType of a shared parameter without an element as reference.
I have the ParameterElement objects collected, but I cannot seem to get UnitTypeId and StorageType from there.
Any tips?

I figured it out.
After refering to Jeremy Tammik’s Shared Parameter GUID reporter :The Building Coder: Shared Project Parameter GUID Reporter

I ended up using his method of creating a temporary transaction to reinsert the binding and retrieving the parameter temporarily to extract the StorageType and UnitTypeId.
This feels like a janky way to do it, but at least it works.

What I changed was that instead of trying to bind the definition to the Project Information (which has no family type) I created a FilteredElementCollector and got the first level, to which I could add both type and instance parameter bindings.