wpf devexpress change theme move position of controls - wpf

In wpf, devexpress,when The theme effect on forms,causes change theme position of controls
in run time ,and it causes moving controls from the position of design time.
Why this is so?

What do you mean by position of controls? Their theme also changes the style of various controls of theirs, so their appearance (including things like padding and margin) will change affecting the overall layout of your app.
If you want the theme to only change the colors of your controls then you will have to create your own custom themes using their Theme Editor tool (not an easy task though). Also you are better off asking this question in their help forums, they are quite helpful and often come up with good solutions.

Related

How do I apply the current Windows theme in my WPF application?

I am working on an WPF application. WPF allows me to style everything but I just want my app to have the same theme as the other Windows applications. I want it to use the current Windows theme. Is this possible?
Whilst you're doing your styling you will be using brushes and colors.
If you want your styling to conform to the windows theme then you should ensure all your brushes and colors used are based on SystemColors.
https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/how-to-paint-an-area-with-a-system-brush?view=netframeworkdesktop-4.8
https://learn.microsoft.com/en-us/dotnet/api/system.windows.systemcolors?view=netcore-3.1
You will find that a number of the default templates do not do this and instead have "hard coded" colors. Hence you will have to provide your own replacement templates for all these.
Unless you have extensive experience of wpf templating you are likely under estimating the amount of work which will be involved.
This is a lot of work.
If you look at custom themes which are available you'll often find the author missed some subtle aspects of controls here and there.

Edit WPF styles for a "designer"

We have a designer that did a whole concept of GUI for our next WPF application.
If we are able to provide him a "user friendly" way to edit styles, he would have done it by itself.
He only has to edit colors, and small things like Margin, default fonts, ...
Naturally, I tought that Blend would be the solution, but I admit I'm struggling:
Blend allow us to edit the template, but we don't really want to change the whole template, just some color around. We made a small dummy app that has all the controls required to be themed, we edit template in a dedicated theme file, but I can't find how to have the same template applied to every control(e.g. button) in our application
We use DevExpress as library, and it appears that most of their component are composed of a lot of subcomponent(for which I cannot just right-click then edit template). Plus it seems that the devExpress theme have the priority over the templates changes(tested by changing background colors by example)
As a pure developer I would create a "style" that would be applied on all controls of a specific type in our application, but I can't see how to create and edit them in blend?
What approach would you take?
You want to use DevExpress Theme Editor. It will allow you to edit all used DevExpress themes in your application. It has a friendly UI which should be usable by your designer.
Another approach is probably not so friendly for your designer but you can also manually override DevExpress themes with your extended ones (require XAML). I am not sure about the controls but that way you can for sure modify brushes.

WIndows Phone Theme Settings

I'm trying to get my app certified with the light theme for Windows Phone. I'm using a few custom ListBox styles, but I can't figure out why no pivot controls are visible. The foreground and background are both white, so they're invisible. I can't find any implicit or applied styles on the pivot control. TextBlocks have the same problem. From what I've read, the theme settings should be handled by the OS shouldn't they?
You don't need to re-define system resources since those are automatically added to the application at runtime, therefore rendering your ResourceDictionary redundant (and pretty much useless). Try applying the default system styles first. Also, post the XAML so that it is easier to help you fix it.

Is it possible to change the animation speeds in Silverlight themes?

Is it possible to change the animation speeds that are used in the Silverlight toolkit themes?
Specifically, I like the look of the Expression Dark theme, however I feel that some of the animations it uses take too long and make it feel sluggish.
I'd like to be able to modify the animation speeds thru a setting, and be able to do so without having to copy the theme to my own and re styling the whole thing. I'm guessing the answer to this is that its not possible, but I'm hoping I'm wrong.
Thanks!
I don't have access to VS now, so I am just thinking out loud here. But I think you could create your own custom controls and derive from the controls you want to change. Then you could override OnApplyTemplate and hopefully find the animation elements you want to change in the visual tree. At that point you should be able to change their values (I think). But it would require a lot of code if you want to change many of the controls. And you would still need to look through the XAML of the templates to determine how to find them in OnApplyTemplate.
I would recommend building your own theme from the Expression Dark theme. They are open source and available for modification.
Inside the Toolkit install you'll find the .Xaml for the theme; you can use that with ISM.

Does overriding default style/controltemplates break theming?

When I override the default style/controltemplate of a standard WPF control in blend using "Edit a Copy" without modifying it (just creating a local copy of if), will this already break theming in some scenarios? In other words, do different themes provide differnt controltemplate- and/or styledefinitions for the standard controls? How can I make sure that my styles/controltemplates respect theming?
Yes, this breaks theming;
Yes, different themes provide different controls styles. If you have MS Blend you can find them in Blend's folder (e.g. in C:\Program Files\Microsoft Expression\Blend 3\SystemThemes\Wpf )
To respect theming, you should also create one style per theme for your control. There are many resources out there on custom control and themes support. Just to mention one: WPF: Changing control style based on the system theme
As a developer you want to author your controls in terms of their functionality. Use default control styles everywhere. Then let the pro's handle the graphic design aspect of it. If you override a control's ControlTemplate you are busy with theming already.
If you do muck around with ControlTemplates try and keep with the standard approach, otherwise once the graphic designer starts working on the application he/she's going to swear at you :)
Themes are collections of styles that target individual controls and redefine their look-and-feel. Any Control for which you've provided a ControlTemplate will either not have it applied or won't be consistent with the theme-pack (depending on whether you access the theme by x:Name or by Type)
If you override DataTemplates, you are fine however. This you can safely do without worrying about theming interference.

Resources