Hello,
Welcome to Microsoft Q&A!
For your requirement, you could examine Generic Types with Reflection. For more info please refer the following code. And here is official document that you could refer to.
var oc = new ObservableCollection<MyClass>();
var toc = oc.GetType();
Type[] typeParameters = toc.GetGenericArguments();
var ctype = typeParameters[0];
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.