I know no good way to make it work. An instance of a defined type
represents something managed on the client, whereas a template is
evaluated on the server. It may be that you could cobble the two
together, but in the end you'd just be putting a complicated wrapper
around exactly the same thing you were doing before. I don't see what
would be gained.
John