How to bind a custom class to runtime