I believe that you should name the style and apply it to each window, as shown below.
In app.xaml / resources ..
<Style x:Key="MyWindowStyle" TargetType="Window"> <Setter Property="WindowStyle" Value="None"></Setter> </Style>
Then in the .xaml .. window
<Window x:Class="MusicRepo_Importer.MyWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" Title="MyStyledWindow" Style="{StaticResource MyWindowStyle}">
This should work, but just using the style with TargetType for Window in the resource will not force Window to use this style, although it seems to work for other elements as well.
Edit:
Found some information regarding applying default styles to a window element.
If you specify TargetType, all instances of this type will have the style applied. However, derived types will not ... seem. <TargetType Style = "{x: Type Window}"> will not work with all of its Differentiation / Window usages. <TargetType style = "{x: Type local: MyWindow}"> will only apply to MyWindow. So the parameters
Use the Keyed style that you specify as the Style property of each window that you want to apply the style. The designer will show a stylized window.
From the question: How to set the default WPF Window style in app.xaml?
The person who answered the question had an interesting idea of ββinheritance from the base window in which the style was applied.
Quintin robinson
source share