Presenter styles and themed grids

This post has 1 Reply | 1 Follower

sumi
Points 1,620
Replied On: Thu, Jan 10 2008 5:18 AM

 Hi there

I have themed grids that also use CellValuePresenters. My problem is now that the theme applies formatting properties to its regular cells, while my customized cells provide a slightly other appearance. If you look at the screenshot below, there are 2 differences:

- the Foreground is not equal. The theme applies a greyish fore color.
-  the theme indents cell text while my format even starts outside of the header's left border position.


What I would like to know is how is the cleanest way to adjust my styles to the theme. Is there a cleaner way than just debug the application with snoop, read out the raw values and apply them to my style?

Thanks for your advice,

Philipp 

code hard @ hardcodet.net
  • Post Points: 20
granth_ig
Points 1,215
Infragistics Employee
Microsoft MVP
Replied On: Wed, Jan 23 2008 5:51 PM

You can find the default XAML for the DataPresenter controls in the following location:

C:\Program Files\Infragistics\NetAdvantage for WPF 2007 Volume 1\DefaultStyles\DataPresenter

The Styles/Brushes are broken into three ResourceDictionaries: DataPresenterGeneric_Express.xaml, DataPresenterGeneric.xaml and DataPresenterGeneric_Brushes.xml. Most of the Styles you need (including the CellValuePresenter) will be found in DataPresenterGeneric_Express.xaml (DataPresenterGeneric.xaml (non-express) just adds Styles not included in the Express versions of the assemblies).

It may be helpful for you to start with the default style, changing only what you need to change, to ensure consistency between layouts. That being said, Snoop is sometimes the best way to work through detail issues like this, so you better keep it handy. Hope this helps!

  • Post Points: 5
Page 1 of 1 (2 items) | RSS