I'm developing a plugin for a WPF application that has a button that launches a dialog pop-up window. So within that application, the launch of that pop-up window is literally two lines:
PluginWindow pluginWindow = new PluginWindow();
pluginWindow.ShowDialog();
The window seems to be inheriting a bunch of unwanted styling from the parent application, though. I can reset the styling on individual components using this technique:
...so my PluginWindow ends up having:
<Window.Resources>
<Style TargetType="{x:Type TextBox}" />
<Style TargetType="{x:Type TextBlock}" />
<Style TargetType="{x:Type Button}" />
<Style TargetType="{x:Type DataGrid}" />
...etc...
</Window.Resources>
However, the reset doesn't seem to apply to any further dialog boxes. For example, my PluginWindow has a custom confirmation dialog box (another WPF Window element) that shows up at one point, and the elements within that confirmation dialog go back to the styling from the parent application.
While I can just apply the same style-resetting technique everywhere, it seems really messy and wrong. It seems like there should just be some way of "cutting the style cord" between the parent application and the PluginWindow so that PluginWindow starts with completely-default styling, along with all of its child windows.
Is this possible to do, and if so how?