Button myButton = new Button(); Type buttonType = myButton.GetType();
DependencyObject myDependencyObject = new DependencyObject(); Type depObjectType = myDependencyObject.GetType();In this example, we create a new instance of DependencyObject, and then call the GetType method on it to retrieve its type. The depObjectType variable will now be of type System.Type, holding the type of the myDependencyObject instance. Package library: Windows.UI.Xaml is part of the Windows Runtime (WinRT) library, which is included in the Windows App SDK. Therefore, the package library for this would be the Microsoft.Windows.SDK.Contracts package.