0

I'm learning on how to implemented themes in an application by use of Wpf.Theme NuGet package. Whenever switching between Themes I can see changes being applied to some of the controls but it does not affect other controls.

I used examples from this question to implement changes in runtime. What do I need to do to make changes to Background color of other elements like Grid and nested children?

<Grid>
    <DockPanel>
        <StackPanel DockPanel.Dock="Top" Margin="3">
            <ComboBox x:Name="cmbThemes" Margin="4" Width="150" SelectedIndex="0">
                <ComboBoxItem Content="None" />
                <ComboBoxItem Content="BureauBlack" Tag="/Themes/BureauBlack.xaml"/>
                <ComboBoxItem Content="BureauBlue" Tag="/Themes/BureauBlue.xaml"/>
                <ComboBoxItem Content="ExpressionDark" Tag="/Themes/ExpressionDark.xaml"/>
                <ComboBoxItem Content="ExpressionLight" Tag="/Themes/ExpressionLight.xaml"/>
                <ComboBoxItem Content="ShinyBlue" Tag="/Themes/ShinyBlue.xaml"/>
                <ComboBoxItem Content="ShinyRed" Tag="/Themes/ShinyRed.xaml"/>
                <ComboBoxItem Content="WhistlerBlue" Tag="/Themes/WhistlerBlue.xaml"/>
            </ComboBox>
        </StackPanel>
        <StackPanel>
            <TextBox AcceptsReturn="True" Name="txtEditor" >Text</TextBox>
            <Button >Button 1</Button>
            <RadioButton >Radion </RadioButton>
            <TextBlock></TextBlock>
            <CheckBox></CheckBox>
            <Label></Label>
        </StackPanel>
    </DockPanel>
</Grid>
Community
  • 1
  • 1
  • fyi, If you have local styles for those controls or styles in user controls or windows then Generic theme or styles won't apply to those. – Versatile Oct 07 '16 at 19:08
  • I saw this : https://github.com/StanislawSwierc/WpfThemesCollection#supported-controls which shows supported Controls. Please see if you are using supported controls or not. – AnjumSKhan Oct 08 '16 at 06:10
  • @AnjumSKhan post your comment as the answer, I did not nest my controls in supported control and that was the issue. – Vladimir Oselsky Oct 10 '16 at 13:29

1 Answers1

1

I saw this : https://github.com/StanislawSwierc/WpfThemesCollection#supported-controls which shows supported Controls. Please see if you are using supported controls or not.

AnjumSKhan
  • 9,647
  • 1
  • 26
  • 38