A powerful, modern WPF application for exploring and examining the XAML templates behind all WPF controls. Perfect for developers who want to understand how WPF controls are constructed internally or need to create custom control templates.
- 🔍 Comprehensive Control Discovery: Automatically scans and lists all WPF controls from the PresentationFramework assembly
- 🎯 Smart Search: Quickly find controls with real-time search functionality
- 📋 Template Visualization: View the complete XAML template for any WPF control
- 💾 Export Options: Copy templates to clipboard or save to files
- 🌙 Modern Dark Theme: Professional, developer-friendly interface
- 📊 Template Analytics: Shows line count and element statistics
- ⚡ Performance Optimized: Efficient template loading and display
- .NET 8.0 SDK or later
- Windows OS (WPF requirement)
- Visual Studio 2022 or VS Code (recommended)
-
Clone the repository
git clone https://github.com/karimAbd-Elrazek/WPF-Control-Template-Explorer.git cd WPF-Control-Template-Explorer -
Build the application
dotnet build
-
Run the application
dotnet run
- Launch the application
- Browse the list of WPF controls on the left panel
- Use the search box to quickly find specific controls
- Click on any control to view its template
- Copy templates to clipboard or save to files for your projects
The application features a clean, modern interface with a control list on the left and template viewer on the right.

View beautifully formatted XAML templates with syntax highlighting and detailed information.

The application uses .NET reflection to:
- Scan Assemblies: Examines the PresentationFramework.dll assembly
- Discover Controls: Finds all public, concrete classes that inherit from Control
- Instantiate Controls: Creates instances of controls to access their templates
- Extract Templates: Uses XamlWriter to serialize ControlTemplate objects to XAML
- Format Output: Provides clean, readable XAML with proper indentation
WPF-Control-Template-Explorer/
├── MainWindow.xaml # Main UI layout
├── MainWindow.xaml.cs # Core application logic
├── App.xaml # Application definition
├── App.xaml.cs # Application startup logic
├── ControlTemplateExplorer.csproj # Project configuration
├── README.md # This file
├── LICENSE # MIT license
└── .gitignore # Git ignore rules
- Framework: .NET 8.0 Windows
- UI Technology: WPF (Windows Presentation Foundation)
- Architecture: MVVM-inspired pattern with code-behind
- Key Technologies:
- System.Reflection for type discovery
- XamlWriter for template serialization
- ObservableCollection for data binding
- Modern WPF styling and theming
- Learning WPF: Understand how built-in controls are structured
- Custom Control Development: Use existing templates as starting points
- Template Customization: Extract and modify templates for your applications
- WPF Education: Great tool for teaching WPF control architecture
- Debugging: Examine control structures when troubleshooting styling issues
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test thoroughly
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Syntax highlighting for XAML templates
- Template comparison functionality
- Export to different formats (PDF, HTML)
- Custom control template validation
- Integration with popular WPF UI libraries
- Template history and favorites
- Dark/Light theme toggle
- Some complex controls may not instantiate properly (handled gracefully)
- Very large templates might take a moment to load
- Custom controls from external assemblies are not included
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by WPF documentation examples
- Built with modern WPF best practices
- Thanks to the WPF community for continuous inspiration
If you encounter any issues or have questions:
- Issues: GitHub Issues
- Discussions: GitHub Discussions
If you find this project helpful, please consider:
- Giving it a ⭐ on GitHub
- Sharing it with other WPF developers
- Contributing to its development
Made with ❤️ for the WPF community