My high-level question is: How can I change style settings on the XamDataGrid? Primarily colors.
I tried the Microsoft WPF standard technique for editing the control's template (by right clicking on it in the Visual Studio designer), but that yielded a minimal template that will not help me.
The Infragistics controls seem to prefer themes instead. Unfortunately, the help on creating a custom theme for an existing Infragistics control (found at http://help.infragistics.com/doc/WPF/2016.1/CLR4.0/?page=themeManager_Creating_New_Custom_Theme.html) includes a "giant leap," telling you to create a custom theme for the control. But of course, such a theme contains all kinds of specific keys that you need to know.
I found in the installed samples a lot of themes for a lot of the controls, but XamTreeGrid is not one of the controls included in them.
How can I get a sample theme definition for the XamTreeGrid to customize? Or if there's a quicker and easier way to change colors, I'm open to suggestions down that path as well.
Thanks,
Ken
Hello Ken,
I suggest taking a look at the Samples Browser.
You can find in on your machine (after you have installed the Infragistics Product) by opening the Start Menu and typing "Samples Browser". After you open it, you can search in it manually or by typing in the search box.
For example if you want to see XamDataGrid or XamTreeGrid themes, go to that Control (e.g. XamTreeGrid) > Styles > Theming.There are 18 themes currently supported plus a default one.
Additionally you can open the attached to this post small sample.
After you selected the colors of your theme if you want to make further color modifications you can use Infragistics Resource Washer.Besides using "Theme" property for setting a theme you can use Resource Dictionary and change the default colors. I suggest also looking in the Samples Browser for Resource Washer, you will find examples of this functionality as well as the XAML and C# Code.
If you need further information concerning this matter, please let me know.
Hi, Nick,
Themes are definitely a confusing area of the Infragistics package. There are three sources of themes, each with a different set: (A) The 18 "built in" ones you point out above, (B) the seven "official" themes installed under C:\Program Files (x86)\Infragistics\..., as sets of XAML files, and (C) the 12 "theme packs" shipped as DLLs (and may only apply to XamDataGrid).
As far as I can tell, the ResourceWasher can only work with the themes in categories B and C, because it needs to define a ResourceDictionary that refers to the theme. I am having trouble figuring out the syntax for the ReferenceDictionary.Source value to reference the B and C categories of themes. And I have no idea how to form the syntax to reference your category A themes.
The sample programs don't help because they build their own internal themes and reference those, so don't show me how to use any of the above.
Can you show me how to define the ResourceDictionary, specifically the Source value, to reference each of the three categories of themes?
Thank you for your feedback.
There are a lot of Infragistics controls which are shared between WPF and Silverlight and different sets of themes are applied for them. You can get the supported themes for the desired Control after adding its Assembly to your project and using Infragistics.Windows.Themes. ThemeManager. GetThemes(false, "DataPresenter").
Using this approach I have created a small app. Both XamDataGrid and XamTreeGrid controls are from XamDataPresenter's family, so I used it to demonstrate the themes functionality. In project "XamDataPresenter_Themes" I used this ThemeManager to register 3 more themes besides the 18 default ones.
As you have observed setting the theme through the property (e.g. Theme = "Metro"), will not add it to the ResourceDictionary and so it will not be washed. In order to wash it (project " XamDataPresenter_ResourceWasher ") you have add it in the ResourceDictionary - perform the folowing steps:- Define the desired theme (e.g. Ig Theme)- Use ThemeManager.GetGroupingsForType(typeof(XamDataPresenter)). Which in this case will return DataPresenter, Editors, Primitives.- Use either the Application's or XamDataPresenter's resources and add Resource Washer and set the WashColor and WashMode.- Add the said groupings in the Resource Washer MergedDictionaries for that theme - PrimitivesIGTheme, EditorsIGTheme, DataPresenterIGTheme.
Note that if you decide to wash the 3 newly added themes you have to reference their namespace:
xmlns:igLipstick=http://infragistics.com/Themes/Lipstick
And again add them to the Merged Dictionary:
<ResourceDictionary.MergedDictionaries> <igLipstick:DataPresenter /> <igLipstick:Editors /> <igLipstick:Primitives /> </ResourceDictionary.MergedDictionaries>
You can take a look in this article for information on Resource Washer:https://www.infragistics.com/community/blogs/mihail_mateev/archive/2011/12/12/using-infragistics-resource-washer-in-wpf-applications.aspx
And in the documentation on how to wash different groups:https://www.infragistics.com/help/wpf/reswash-using
Thanks for your explanations and sample projects. Using those, I was able to figure out how to resource wash individual themes on my XamTreeGrid.
Unfortunately, the effects I can get will not look good in our app. Our design has a flat look, which knocks out all but two of the available themes (Metro and Office2013). And washing these adds color to way too many elements (changing text, button outlines, etc. where we do not do so elsewhere in our app). I would prefer to be able to style the couple of Infragistics controls we use the way we want, rather than restyling our app to match the Infragistics controls.
So I am back to my original question: Given that I want to build a custom theme, and none of the theme source (XAML) files I can find have a definition for xamTreeGrid: How can I get a sample theme definition for the XamTreeGrid to customize?
The XamTreeGrid is from the XamDataPresenter family, so you will need the DataPresenter's resources. They are located in " C:\Program Files (x86)\Infragistics\2017.1\WPF\DefaultStyles\DataPresenter"
You will need :DataPresenterGeneric.xamlDataPresenterGeneric_Brushes.xamlDataPresenterGeneric_Express.xaml
And you can add them in the Application resources:
<Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Themes\DataPresenterGeneric.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary></Application.Resources>