I use MaterialDesign for style controls in wpf add.
I change all controls use MaterialDesign theme. I want to change windows style(WindowTitle, close,min,max button).
How to change this?
For this purpose you need to set Window Style (Border settings) = None and need to set user controls manually and apply code as per your requirement.
Or you can built your own custom control for this.
Related
So I have a simple WPF app with a menu and a toolbar/toolbartray inside a Grid. By default, the colors don't match (the menu is grey and the toolbar is blue - see image)
I have tried specifically setting the background color but there are then other issues (toolbar overflow button colors and sub menu colors.)
Strikes me that by default, the colors should match and also match the system theme. Is there a magic setting? Surely I can't need to specifically style everything?
Thanks
Get default ControlTemplates of that controls.
Menu
ToolBar
Add new ResourceDictionary to your project and insert that templates
Change background properties in root Borders of templates.
Are there global styles in Winforms as there are in WPF?
I'd like to be able to, for example, set ForeColor to be used by all the labels that exist within the app. Is there any solution, or do I have to do the changes manually for all the controls separately?
Most controls will inherit the font from their parent - so try setting the font styles you want on the window.
This question is in regard to the Telerik RadButtons for Silverlight. I have themes per customer on the site where Silverlight is used. I am able to change the background and foreground colors by setting the Background and Foreground brush properties. However, the styles revert to the standard colors while hovering over the button. How do I change the colors for all button states?
I attempted to set the Resources dictionary as shown on Telerik Styles, but it appears to be read-only.
More information on how to style a RadButton you can find here: http://www.telerik.com/help/silverlight/radbuttons-styles-and-templates-overview.html
I have made one custom user control (search text box), which basically consists of one dock panel, and in the panel there are two controls: textbox and button.
I have set some default appearance for this control, which consists of setting a border on the user control, and setting no borders and no background on the textbox, and I have created a custom style for the button. So far this control looks the way I want, and is working correctly.
The problem arises when I want to allow themes for my application. When I put custom styles for basic windows controls (Button, TextBox, ListBox, etc), they are displayed properly with the new theme. But I don't know how to make a template for my custom control. Any attempt ended up in the control not showing at all at runtime.
What exactly must be done in the new template for this control? Do I need to make a template for the User control, and for the textbox and the button controls also?
You are mixing up user controls and custom controls here. What you described above is a user control, and you cannot apply new templates to it.
I'm using the Infragistics WPF controls in a new project, and I'd like to take advantage of their themes support. I'm able to change the theme of my window (and toolbars) via the OnThemeChanged event, but I can't figure out how to change the theme of child controls (such as the XamDockManager), as they're added at runtime.
I'm new to WPF and Infragistics controls so any clarification is appreciated.
I discovered the answer.
You need to set the control's Theme property to Theme.CurrentTheme. This will cause the controls to automatically pick up the new theme via their internal OnThemeChanged events.
This is the code I used, simplified a bit for this answer:
<igDock:ContentPane xmlns:igTheme="clr-namespace:Infragistics.Windows.Themes;assembly=Infragistics3.Wpf.v9.1">
// other stuff
...
<igDock:XamDockManager "Theme="igTheme:ThemeManager.CurrentTheme" />
</igDock:ContentPane>