Hi,
I';m not new to WPF but I'm finding getting the theming working on your controls like wading through thick mud.
Is there a simple guide to get people started?I have the Ultimate edition for a project I'm working on and I can't even find pre-compiled theme DLLS after wading through the enormous number of directoried and dlls ...
I took the DataGrid theme XAML dictionary and popped it into my own apps styles dll and now I cannot find the DLL that contains the CultureValueConverter that is missing (I have the DataPresenter DLL referenced). Searching the online help I can only find references to this object in relation to SilverLight.
Serisouly guys, I love the controls and this is the 4th employer I've recommended them too but PLEASE, PLEASE reduce the searching and inbuilt obfuscation, it's getting just plain too hard to find stuff in the dirth of options available ...
Where do I start?
I should add here that I have subclassed the Controls so the type is actually not XamDataChart or XamDataGrid ... I have just created thin wrappers to encapsulate custom functionality.
I've so far completely failed to get any Infragistics themes to apply to the controls.
Not even sure which DLLs need to be referenced as Referenceing Forest theme and setting the theme manager to use this one does nothing at all.
findjammer3 said:I should add here that I have subclassed the Controls so the type is actually not XamDataChart or XamDataGrid ... I have just created thin wrappers to encapsulate custom functionality.
That makes a big difference since WPF uses the actual type as the key when searching for implicit/local styles - so your derived class' type - and therefore any styles we provide in our themes will not be picked up by WPF. You might want to review this post about common Theme/Style issues like this or other posts with similar questions like this one.
OK, What would you suggest in this scenario? Is there some plain XAML Styles for the Grid I can use an update with my Type?
findjammer3 said: OK, What would you suggest in this scenario? Is there some plain XAML Styles for the Grid I can use an update with my Type?
You could take the xaml from the DefaulStyles folder and change them but that won't help with setting the Theme property since the xaml it uses is embedded in the assemblies. As suggested in the forum post I linked to, you could call SetResourceReference in the ctor of your wrapper class passing the appropriate type of ours that you are deriving from.
Thanks for the help so far, appreciated. I've just tried the simple approach so far and no luck.
I have this as my class declaration in code:
public class MangoDynamicDataGrid : XamDataGrid
And in the ctor for this I have placed:
this.SetResourceReference(StyleProperty, typeof(XamDataGrid));
And the grids are still completely unstyled. So from what you have said the default style is embedded in the Infragistics.WPF4.DataPresenter.v11.2 dll and this SetResourceReference method should tell this control to use that default style.
Are there any other DLLs I should be referencing in order to get this behaviour to work?
Could creating a style with my type as the target type and then setting the based on property worth trying? I'm a bit confused as to why your solution doesn't work however.
Thanks for the demo app.
I've looked it over and it describes exactly what I tried ... it didn't work in my application.
The specific problem is that setting these properties / executing the methods aren't doing what you said they would.
I'll try and get a sample together later to illustrate the problem.
Do you have an email address I can send the sample to?
You haven't provided me with a sample or a description of what exactly is not working so it is hard to say what is going on. I can say that both approaches (setting the dynamicresource in the xaml or calling setresourcereference in code) do allow WPF to pick up the styles for the control and allow theming to continue to work. I've attached a sample showing both approaches. With regards to BasedOn, you can only use that with a StaticResource - not a DynamicResource - in which case I believe it just picks up the generic style at the time it is created.
I've managed to get it to style but copying all the Generic styles into another dictionary and globally replacing the XamDataGrid type declaration with my own Type ...
This is the only approach that seems to work for me ...