ShowMeTheXAML library for providing a simple way to display a control and its corresponding XAML.
$ dotnet add package ShowMeTheXAML.MSBuildA WPF component making it easy to show the corresponding XAML for WPF custom styles and controls. It was built out of a need to shows the XAML for the theme library MaterialDesignInXamlToolkit. You can see it working in the demo application for MaterialDesignInXamlToolkit.
PM> Install-Package ShowMeTheXAML.MSBuild This will also install the ShowMeTheXAML package as well.App.xaml.csprotected override void OnStartup(StartupEventArgs e)
{
XamlDisplay.Init();
base.OnStartup(e);
}
PM> Install-Package ShowMeTheXAML.AvalonEdit
In App.xaml include the resource dictionary.<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/ShowMeTheXAML.AvalonEdit;component/Themes/xamldisplayer.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
<smtx:XamlDisplay UniqueKey="SomeUniqueString">
<StackPanel>
<Button Content="Some Content" />
<TextBlock Text="Text" />
</StackPanel>
</smtx:XamlDisplay>