.NET 4.5 TypeInfo Reflection: Listing 2
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
/// An empty page that can be used on its own or navigated to within a Frame.
public sealed partial class MainPage : Page
/// Invoked when this page is about to be displayed in a Frame.
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
Assembly myAssembly = this.GetType().GetTypeInfo().Assembly;
IEnumerable<TypeInfo> myTypes = myAssembly.DefinedTypes;
MyDefinedTypes.DataContext = myTypes;
private void MyDefinedTypes_SelectionChanged(object sender, SelectionChangedEventArgs e)
if (e.AddedItems.Count > 0)
TypeInfo selectedTypeInfo = e.AddedItems.First() as TypeInfo;
TypeInfoDetails.DataContext = selectedTypeInfo;
TypeInfoDetails.Visibility = Windows.UI.Xaml.Visibility.Visible;
Eric Vogel is a Sr. Software Developer at Kunz, Leigh, & Associates in Okemos, MI. He is the president of the Greater Lansing User Group for .NET. Eric enjoys learning about software architecture and craftsmanship, and is always looking for ways to create more robust and testable applications. Contact him at firstname.lastname@example.org.