Edit WPF styles for a "designer" - wpf

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.

Related

wpf devexpress change theme move position of controls

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.

custom layout in WPF that works with Blend?

in my project we have a reoccurring dialog layout that i'm hoping to consistently replicate between each of the similar dialogs.
In the template dialog, we have a grid that contains a logo and in the center of the dialog has controls specific to that particular instance of the dialog
my hope is to somehow consistently replicate the look, like a template, across each of the dialogs.
I think I want a layout control, where content can be added to the center of the grid
I want to use Blend, such that our designers can manipulate the controls specific to the individual dialog while looking at the template
is there a way to do this? I'm I looking in the wrong direction by thinking of a custom layout control? would I be better off with some type of grid template?
Here is a great way to do this - How to create a WPF UserControl with NAMED content
my preferred is not the answer to the above question, rather the comment
"The answer is to not use a UserControl to do it.
Create a class that extends ContentControl"

Image Control disapear after it's dragged in Design

I'm a WPF newbie and, unlike WinForms, I have a hard time to setup things in the design window.
My first obstacle is the Image control. After I drag it in the Design window it disappears and there's no way for me to edit its properties (like with the button control for example). The only way to make changes is via the XAML code which isn't very visual and intuitive.
Is there a way to keep editing the Image control in design mode? (example, move it around, select it to view its property panel, etc.)
All you should need to do is give the image control a fixed height and width and it should stay in the designer.
The best thing about the XAML is which separated from code for better re usability like asp.net. It's best you to learn different layouts such as grid, wrappanel, stackpanel etc. Then, you will feel the power of xaml. Else, you can choose the XAML building tools.
Link to refer

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.

Custom Controls with Blend

I'm building custom control for my Silverlight 2 app. It's in one SL class project, and it contains two files:
MyControl class, inherited from Control, with few DepedencyProperties
themes/generic.xaml, with visual elements (ControlTemplate), states for VSM and transitions
I created whole xaml by hand, and it works, but want to use Blend2(SP1) for editing! When i open generic.xaml in Blend, and switch to Resources tab I don't have anything to edit.
For example, when I put that visual template and states definition to App.xaml (of my main SL project), I can access all elements and States through Resources and States tabs, and edit them visually.
Does Blend even support editing generic.xaml from SL2 class project?
What's the best practice for building custom controls? I don't want to my custom control depends on anything from main SL2 project, but want them to be skinnable, and be able to change skins (themes) dynamically.
You can edit this with Blend.
Open your controls project in Blend.
Open your generic.xaml
click the Resources tab
Expand generic.xaml
Double click the style resource you want to edit.
In the Objects and Timeline section, right click the Style and select "Edit Control Parts -> Edit Template"
Now you can edit the template in the generic.xaml. Sounds like you're already following best practices by having the parts and states. If you want the full blown best practices take a look at this detailed post on how to deal with design time extensibility. There you will find out how to do the Visual Studio and Blend design time stuff for Silverlight.
I recreated whole project, and suddenly can edit my generic.xaml from Resources. But can't add news stated in Blend, for that I must go to xaml.

Resources