WPF application using DevExpress Themes


(Bob Russell) #1

I am still exploring WPF with an emphasis on using Dev Express WPF and Themes. I have the Dev Express package on trial.

I am finding it difficult to figure out how to get a selected theme to operate application wide (by having the main window as a themed window). The main problem of course is that all the documentation and web examples use associated C# code, and whilst Oxidiser is useful in converting the operational code, setting up the underlying objects / classes etc is difficult.

I have successfully got a custom themed control to show on a WPF grid, but getting the whole window to be themed is proving elusive!

Does anyone have, or can point me to, a simple, bare bones project that uses Dev Express to set an application wide theme?

Any thoughts / suggestions welcome as always.

Regards Bob Russell


(Alan Olson) #2

Its pretty simple, actually.

Add this to your main window’s constructor:

ThemeManager.ApplicationThemeName := Theme.Office2016ColorfulName;

Of course, use whatever theme you choose. Make sure DevExpress.Xpf.Core is referenced in your uses clause.

Alan


(Bob Russell) #3

Hi Alan, Don’t you just love coding!! As it happens, I just came across this (actually in a C# context, but good to know that it works in Elements as well. Why do the “simple” things seem so simple, once you know? I’ve spent hours with all sorts of stuff. Ah well, many thanks for your continuing support!

Bob


(Alan Olson) #4

anytime!


(marc hoffman) #5

keep in mind that when working with Elements for .NET projects, anything that you come across for C# will also work for you. just a matter of adjusting the language syntax to, say, Oxygene, but all the APIs and all the other concepts are exactly the same.


(Bob Russell) #6

Indeed, that’s a great thing. My challenge is that the underlying concepts are sometimes new to me (it’s easy in Delphi to “ignore” all that kind of thing - can be an advantage, but actually hides what’s really going on) and getting the “environment” in place can prove difficult. Anyway the journey (and the fun) goes on.

Regards Bob Russell