DependencyObject obj = new DependencyObject(); Type objType = obj.GetType();
using System.Windows.Controls; UserControl userControl = new UserControl(); Type controlType = userControl.GetType();In this example, a new instance of UserControl is created, and then GetType method is used to get the runtime type of the UserControl. Package Library: The GetType method is a part of the System.Windows.dll package library.