Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Styles vs Themes Namespaces #3587

Closed
amkuchta opened this issue Aug 27, 2019 · 5 comments · Fixed by #3796
Closed

Styles vs Themes Namespaces #3587

amkuchta opened this issue Aug 27, 2019 · 5 comments · Fixed by #3796
Milestone

Comments

@amkuchta
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Within MA.M, there are two separate namespaces for Theme vs Style (which also contains a Theme directory). This is not intuitive, as the Theme Directory contains some styles (e.g. HamburgerMenu), and the actual themes for the application are located in the Style/Theme directory.

Describe the solution you'd like

I suggest re-ordering the name spaces as follows:

  • Move the application theme and accents under MA.M/Themes
  • Move all styles under MA.M/Styles; include custom templates in the file with the appropriate themes (e.g. HamburgerMenuTemplate belongs in Styles/Controls.HamburgerMenu.xaml)

This makes it much easier to find the code needed to make an update to a control for a user's personal implementation. It also makes application theme information much easier to find, as it is in the most logical location.

Additional context

N/A

Closed Issues

N/A

@amkuchta
Copy link
Contributor Author

I could also see creating a new directory or set of directories specifically for templates:

  • MA.M/Templates or
  • MA.M/Templates/ControlTemplates and MA.M/Templates/DataTemplates or
  • MA.M/ControlTemplates and MA.M/DataTemplates

These could also be nested in Styles:

  • MA.M/Styles/Templates or
  • MA.M/Styles/Templates/ControlTemplates and MA.M/Styles/Templates/DataTemplates or
  • MA.M/Styles/ControlTemplates and MA.M/Styles/DataTemplates

A more extreme approach would be to create sub-directories or naming conventions for each control type:

  • MA.M/Styles/Button/Button.Styles.xaml and MA.M/Styles/Button/Button.Templates.xaml
  • MA.M/Styles/HamburgerMenu/HamburgerMenu.Styles.xaml and MA.M/Styles/Button/HamburgerMenu.Templates.xaml
  • etc.

or (I personally find this one the easiest to read / navigate, and it strikes a great balance between separation and not having to nest things down too many directory layers):

  • MA.M/Styles/Button.Styles.xaml and MA.M/Styles/Button.Templates.xaml
  • MA.M/Styles/HamburgerMenu.Styles.xaml and MA.M/Styles/HamburgerMenu.Templates.xaml
  • etc.

Again, although the separation will be difficult and tedious now, it makes things much easier to find later down the line, not just for users, but for future contributors. One of the things I struggle with the most (even as a long time user of the library) is finding where the exact item is that I need to change.

@bigworld12
Copy link
Contributor

this has been bugging me for years, it is so hard to find a specific style or a template without searching every folder in the project, would love to see that change, i also agree on the last convention you proposed. (MA.M/Styles/Button.Styles.xaml and MA.M/Styles/Button.Templates.xaml)

@amkuchta
Copy link
Contributor Author

@punker76 how do you feel about this? I can start tackling it, but given the scope of the changes, I am worried that it will affect the work that you are putting in with regards to #3585 . If you don't think it will mess you up, I can take a swing at this.

@punker76
Copy link
Member

@amkuchta I’m still investigating this, how we can provide this in an easy way. The upcoming Visual Studio will help us, because it has a better Intellisence for own resource dictionaries included. R# helps me and other since years. So please wait for a change for this issue. I’m not a friend for such a big change of separating each style and template to it’s own file. Thx

@amkuchta
Copy link
Contributor Author

@punker76 I agree that improved Intellisense will help, but that does not help advanced users who have to search through the code to find entire templates or styles that they may need to override (or modify in a way that requires copying large chunks of code). For that reason, I think that a refactor should occur, especially since there are multiple locations where directories like Styles and Themes occur.

@punker76 punker76 added this to the 2.0.0 milestone May 12, 2020
punker76 added a commit that referenced this issue May 12, 2020
contains
- MahApps.Styles.ContentControl.FloatingMessageContainer
- MahApps.Styles.ContentControl.PathIcon
punker76 added a commit that referenced this issue May 16, 2020
… and style MahApps.Styles.TabControl.AnimatedSingleRow
punker76 added a commit that referenced this issue May 16, 2020
punker76 added a commit that referenced this issue May 16, 2020
punker76 added a commit that referenced this issue May 16, 2020
punker76 added a commit that referenced this issue May 16, 2020
punker76 added a commit that referenced this issue May 16, 2020
…entAlignment attached properties to HeaderedControlHelper
punker76 added a commit that referenced this issue May 16, 2020
- Rename MahApps.Templates.Button.Previous to MahApps.Templates.Button.Calendar.Previous
- Rename MahApps.Templates.Button.Next to MahApps.Templates.Button.Calendar.Next
- Rename MahApps.Templates.Button.Header to MahApps.Templates.Button.Calendar.Header
- Make PreviousCalendarButtonStyle public and rename  to MahApps.Styles.Button.Calendar.Previous
- Make NextCalendarButtonStyle public and rename to MahApps.Styles.Button.Calendar.Next
- Make HeaderCalendarButtonStyle public and rename to MahApps.Styles.Button.Calendar.Header
punker76 added a commit that referenced this issue May 16, 2020
punker76 added a commit that referenced this issue May 16, 2020
punker76 added a commit that referenced this issue May 16, 2020
punker76 added a commit that referenced this issue May 17, 2020
punker76 added a commit that referenced this issue May 17, 2020
punker76 added a commit that referenced this issue May 17, 2020
punker76 added a commit that referenced this issue May 17, 2020
punker76 added a commit that referenced this issue May 17, 2020
punker76 added a commit that referenced this issue May 17, 2020
…s.Styles.ToggleButton.TreeViewItem.ExpandCollapse
punker76 added a commit that referenced this issue May 17, 2020
punker76 added a commit that referenced this issue May 17, 2020
punker76 added a commit that referenced this issue May 17, 2020
punker76 added a commit that referenced this issue May 17, 2020
…pps.Styles.Button.MetroWindow.Close.Light.Clean
punker76 added a commit that referenced this issue May 17, 2020
…ps.Styles.Button.MetroWindow.Close.Dark.Clean
punker76 added a commit that referenced this issue May 17, 2020
…to MahApps.Styles.Button.MetroWindow.Close.Light.Clean.Win10
punker76 added a commit that referenced this issue May 17, 2020
…o MahApps.Styles.Button.MetroWindow.Close.Dark.Clean.Win10
punker76 added a commit that referenced this issue May 17, 2020
- Rename Clean/Clean.xaml to Clean/Controls.xaml
- Rename Clean/CleanGroupBox.xaml to Clean/GroupBox.xaml
- Rename Clean/CleanStatusBar.xaml to Clean/StatusBar.xaml
- Rename Clean/CleanWindow.xaml to Clean/MetroWindow.xaml
- Rename Clean/CleanWindowButtonCommands.xaml to Clean/WindowButtonCommands.xaml
- Rename Clean/CleanWindowButtons.xaml to Clean/WindowButtons.xaml
- Rename Clean/CleanWindowCommands.xaml to Clean/WindowCommands.xaml
punker76 added a commit that referenced this issue May 18, 2020
- Rename VS/Styles.xaml to VS/Controls.xaml
- Rename VS/Window.xaml to VS/MetroWindow.xaml
punker76 added a commit that referenced this issue May 18, 2020
…ard.Expander.Expand.VS and MahApps.Storyboard.ExpanderCollapse to MahApps.Storyboard.Expander.Collapse.VS
punker76 added a commit that referenced this issue May 18, 2020
…o to MahApps.Styles.TextBox.Window.QuickLaunch.VisualStudio
punker76 added a commit that referenced this issue May 18, 2020
- Create style MahApps.Styles.FlipView
- Rename FlipViewNavigationButton to MahApps.Styles.Button.FlipView.Navigation
punker76 added a commit that referenced this issue May 18, 2020
- Add style MahApps.Styles.Flyout
- Rename MahApps.Templates.FlyoutHeader to MahApps.Templates.Flyout.Header
punker76 added a commit that referenced this issue May 18, 2020
- Rename MahApps.Templates.MetroTabControl.KeepVisualTreeInMemoryWhenChangingTabs to MahApps.Templates.MetroTabControl.KeepVisualTreeInMemory
- Rename MahApps.Templates.MetroTabControl.DoNotKeepVisualTreeInMemoryWhenChangingTabs to MahApps.Templates.MetroTabControl.DoNotKeepVisualTreeInMemory
punker76 added a commit that referenced this issue May 18, 2020
- Rename MahApps.Styles.MetroThumb.RangeSlider.HorizontalMiddleThumb to MahApps.Styles.MetroThumb.RangeSlider.Horizontal.Middle
- Rename MahApps.Styles.MetroThumb.RangeSlider.VerticalMiddleThumb to MahApps.Styles.MetroThumb.RangeSlider.Vertical.Middle
- Rename MahApps.Styles.MetroThumb.RangeSlider.HorizontalMiddleThumb.Win10 to MahApps.Styles.MetroThumb.RangeSlider.Horizontal.Middle.Win10
- Rename MahApps.Styles.MetroThumb.RangeSlider.VerticalMiddleThumb.Win10 to MahApps.Styles.MetroThumb.RangeSlider.Vertical.Middle.Win10
punker76 added a commit that referenced this issue May 18, 2020
punker76 added a commit that referenced this issue May 18, 2020
- Rename MahApps.Storyboard.DialogShown to MahApps.Storyboard.Dialogs.Show
- Rename MahApps.Storyboard.DialogClose to MahApps.Storyboard.Dialogs.Close
punker76 added a commit that referenced this issue May 18, 2020
- Use MahApps.Styles.Slider.Win10 as default
- Use MahApps.Styles.RangeSlider.Win10 as default
punker76 added a commit that referenced this issue May 19, 2020
- Add Controls.MenuItem.xaml
- Add Controls.Menu.xaml
- Add VS/MenuItem.xaml
- Add VS/ContextMenu.xaml
punker76 added a commit that referenced this issue May 19, 2020
(GH-3587) Last changes to Styles, Themes and Templates
punker76 added a commit that referenced this issue May 22, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Development

Successfully merging a pull request may close this issue.

3 participants