I'm trying to use both .NET controls and Syncfusion controls in the same window, and would like to apply the SystemTheme to all. I've added the references to SfSkinManager.WPF and SystemTheme.WPF.
I've added the below to my window.
syncfusionskin:SfSkinManager.Theme="{syncfusionskin:SkinManagerExtension ThemeName=SystemTheme}"
But, my .NET controls are not getting the style. For example, a <TextBox>. Second to this, is it possible to derive a new style from the Syncfusion style (BasedOn="..."), if I wanted a <TextBox> to have all of the normal Syncfusion styling, but have a different Foreground.
Thank you.
|
# MainWindow.xaml
<Window
syncfusionskin:SfSkinManager.Theme="{syncfusionskin:SkinManager ThemeName=SystemTheme}”>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Syncfusion.Themes.SystemTheme.WPF;component/MSControl/TextBox.xaml"/>
<ResourceDictionary Source="/Syncfusion.Themes.SystemTheme.WPF;component/ButtonAdv/ButtonAdv.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.Resources>
<Style TargetType="TextBox" BasedOn="{StaticResource WPFTextBoxStyle}">
<Setter Property="Foreground" Value="Red"/>
</Style>
<Style TargetType="syncfusion:ButtonAdv" BasedOn="{StaticResource SyncfusionButtonAdvStyle}">
<Setter Property="Foreground" Value="Red"/>
</Style>
</Grid.Resources>
<TextBox HorizontalAlignment="Left" Height="23" Margin="10" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>
<syncfusion:ButtonAdv Content="ButtonAdv" HorizontalAlignment="Left" Height="29" Label="Click" Margin="10" VerticalAlignment="Center" Width="97"/>
</Grid>
</Window>
|
This was what I needed. Thank you.
Hi,
I've tried to use your advice
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Syncfusion.Themes.Metro.WPF;component/ButtonAdv/ButtonAdv.xaml"/>
<ResourceDictionary Source="/Syncfusion.Themes.Metro.WPF;component/MSControl/TextBox.xaml"/>
</ResourceDictionary.MergedDictionaries>
Die Ressource "buttonadv/buttonadv.xaml" kann nicht gefunden werden.
What happened?
Thank you for your help.
Regards,
Peter
Hi Peter,
We have checked your query, "Resource cannot found". We have prepared the sample with the correct source path for the Metro theme. Please find the sample for reference.
<ResourceDictionary> |