Reputation: 16588
I've just started developing a WPF application. This is not my first WPF app, but it will be the first that needs some polish. I know quite a bit about the "plumbing" of WPF such as binding, etc., but very little about how to polish it up. I don't need a snazzy UI. I just need something that looks like a native Windows app. For instance, if the app runs on XP, I want it to look like an XP app and pick up the user's UI theme. Same thing on Vista, etc.
How can I do this?
Upvotes: 9
Views: 2670
Reputation: 105
You don't have to do anything - WPF does it for you.
EDIT: It does. Run it with Aero/Luna and then Classic.
Upvotes: 1
Reputation: 17775
You should be able to put this into the application's OnLoad event to use the Vista theme, for example:
Uri uri = new Uri("PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component\\themes/aero.normalcolor.xaml", UriKind.Relative);
Resources.MergedDictionaries.Add(Application.LoadComponent(uri) as ResourceDictionary);
or for the Windows XP theme: themes/Royale.normalcolor.xaml
Upvotes: 4