C # / WPF: Aggiungere Window.Style, anche se un ResourceDictionary esiste già
-
16-09-2019 - |
Domanda
Sto cercando di aggiungere due Datatriggers alla mia finestra di WPF. Normalmente, questo dovrebbe funzionare tramite l'aggiunta di
`<Style TargetType="{x:Type TextBlock}"></Style>`
per le Window.Resources. In questo caso, ho già
`<ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />`
in esso. C'è un modo per ignorare le definizioni da lì?
Grazie mille!
Saluti
Soluzione
Prova questo:
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- Other stuff here -->
<Style .../>
</ResourceDictionary>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow