Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
overriding themes
posted

Hi,

 I'm using the themes but would like to override some properties of them, namely foreground color. But when I try it in code, the changes don't seem to take effect.  Namely

xdg.Theme = "Onyx";

xdg.Foreground = new SolidColorBrush(Colors.Black);

 Doesn't seem to work.  Any ideas?  Thanks!

-Matt

  • 4850
    Offline posted

    Hi Matt,

    The reason it is not doing what you want is because the XamDataGrid consists of a complex tree of elements that have individual default styles that include different default Foreground setters. For example, if you wanted to change the foreground of the field labels you would supply a style for the LabelPresenter that supplied a different Foreground setting.

    BTW, the best way for you to find out what settings are being applied to specific elements (and where the values are coming from) is to run the Snoop utility (found at http://www.blois.us/Snoop/).