MaterialDesignInXamlToolkit
MaterialDesignInXamlToolkit copied to clipboard
Theme brush rename
Right now there is not a good standardization of brush name, or how to add new brushes to the theme. These have also deviated from the latest material design guidance.
The plan is to introduce the new brush names alongside the current brushes; however the old brushes names should be considered obsolete with the intention to remove them in the 5.x release.
This issue is a request for comment on the design moving forward.
Brush naming rules:
- Brush names will be prefixed with "MaterialDesign.Brush."
- Foreground brushes will be named with their corresponding brush with ".Foreground" suffix appended
- Color resources will be named with their corresponding brush with ".Color" suffix appended
- "Mid" or default colors will have "mid" removed from their names for brevity
- Brushes used by controls should be prefixed with "MaterialDesign.Brush.<ControlName>.<BrushName>"
This will greatly expand the total number of brushes, however with the use of extension methods on ITheme
many of these should not need to be set directly unless greater customization is desired.
Feedback?
Here is the current set of theme brushes as well as some of the proposed new names: PrimaryHueLightBrush => MaterialDesign.Brush.Primary.Light PrimaryHueLightForegroundBrush => MaterialDesign.Brush.Primary.Light.Foreground PrimaryHueMidBrush => MaterialDesign.Brush.Primary PrimaryHueMidForegroundBrush => MaterialDesign.Brush.Primary.Foreground PrimaryHueDarkBrush => MaterialDesign.Brush.Primary.Dark PrimaryHueDarkForegroundBrush => MaterialDesign.Brush.Primary.Dark.Foreground SecondaryHueLightBrush => MaterialDesign.Brush.Secondary.Light SecondaryHueLightForegroundBrush => MaterialDesign.Brush.Secondary.Light.Foreground SecondaryHueMidBrush => MaterialDesign.Brush.Secondary SecondaryHueMidForegroundBrush => MaterialDesign.Brush.Secondary.Foreground SecondaryHueDarkBrush => MaterialDesign.Brush.Secondary.Dark SecondaryHueDarkForegroundBrush => MaterialDesign.Brush.Secondary.Dark.Foreground MaterialDesignValidationErrorBrush => MaterialDesign.Brush.<ControlName>.ValidationError MaterialDesignBackground => (removed; use MaterialDesign.Brush.Background) MaterialDesignPaper => MaterialDesign.Brush.Background MaterialDesignCardBackground => MaterialDesign.Brush.Card.Background MaterialDesignToolBarBackground => MaterialDesign.Brush.ToolBar.Background MaterialDesignBody => MaterialDesign.Brush.Text.Foreground MaterialDesignBodyLight => MaterialDesign.Brush.Text.Light.Foreground MaterialDesignColumnHeader => MaterialDesign.Brush.DataGrid.ColumnHeaderForeground and MaterialDesign.Brush.ListView.GridViewColumnHeaderForeground MaterialDesignCheckBoxOff => MaterialDesign.Brush.CheckBox.CheckOff MaterialDesignCheckBoxDisabled => MaterialDesign.Brush.CheckBox.CheckDisabled MaterialDesignTextBoxBorder => (this brush will need to be multiplied for all controls) MaterialDesign.Brush.TextBox.Border MaterialDesignDivider => (replaced with control specific brushes) MaterialDesignSelection => (replaced with control specific brushes) MaterialDesignToolForeground => (replaced with control specific brushes) MaterialDesignToolBackground => (replaced with control specific brushes) MaterialDesignFlatButtonClick => MaterialDesign.Brush.ToolBar.Button.MouseOver MaterialDesignFlatButtonRipple => MaterialDesign.Brush.<Control>.RippleFeedback MaterialDesignToolTipBackground => MaterialDesign.Brush.ToolTip.Background MaterialDesignChipBackground => MaterialDesign.Brush.Chip.Background MaterialDesignSnackbarBackground => MaterialDesign.Brush.Snackbar.Background MaterialDesignSnackbarMouseOver => MaterialDesign.Brush.Snackbar.MouseOver MaterialDesignSnackbarRipple => MaterialDesign.Brush.Snackbar.RippleFeedback MaterialDesignTextFieldBoxBackground => (replaced with control specific brushes) MaterialDesignTextFieldBoxHoverBackground => (replaced with control specific brushes) MaterialDesignTextFieldBoxDisabledBackground => (replaced with control specific brushes) MaterialDesignTextAreaBorder => (replaced with control specific brushes) MaterialDesignTextAreaInactiveBorder => (replaced with control specific brushes) MaterialDesignDataGridRowHoverBackground => (replaced with control specific brushes)
Total renaming of the brushes? I like it, no problems. But before update old versions to newer (v4.3 or v5.0), we are should be aware about it. Thanks. Some of my projects still using v3.
I'm all for progress even with breaking changes. Bring it :)
@Erapchu yea that plan is to start the rename soon but leave both brush names in place for the new few version to give people time to update.
I really like the unification of the resources name header. A welcome change nonetheless.
Looks good. Really like the consistency in naming!
What I also like is that more colors are added. Yesterday I looked for the brushes of the Chip its delete button (to use in a control next to it) and then sadly found out that they were hard coded inside of the Chip style.