Control Styles should be named
See original GitHub issueWhile investigating this, I noticed an issue for this that is a complete show stopper: there is no way to override the default TabViewItem style. Unlike some other controls, the TabViewItem does not follow the pattern of:
<Style TargetType="ControlName" BasedOn="DefaultControlNameStyle"/>
<Style x:Key="DefaultControlNameStyle" TargetType="ControlName">
...
</Style>
but rather just exposes the complete template as the default style leaving users with no choice of easily overriding the default style. However that is something that we would need for this feature to be easily usable. @ranjeshj @stmoy @StephenLPeters Is that something we can change to make that customization easier?
@michael-hawker FYI
_Originally posted by @chingucoding in https://github.com/microsoft/microsoft-ui-xaml/issues/2587#issuecomment-732463534_
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:14 (9 by maintainers)
Top Results From Across the Web
c# - Naming convention for controls
I like the "implementation independent" name idea in theory, but in practice I find the refactoring of a control name to be near-instantaneous....
Read more >Code-style naming rules - .NET
The naming style to associate with the rule, for example, that the name must be capitalized or start with an underscore.
Read more >How to create a style for a control - WPF .NET
Apply a style programmatically To assign a named style to an element programmatically, get the style from the resources collection and assign ...
Read more >VCL Per-Control Styles – New in RAD Studio 10.4
This property takes as a value the name of the one of the styles active for the application, and applies the style to...
Read more >Styling the Controls - Telerik UI for WPF - Documentation
This article shows how to customize the Telerik controls in NoXaml scenario. An important step to remember is to always base your custom...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Default[Control name]Style seems like the best approach, and should be used for all controls that present UI.
It also allows for Variations like “AccentButtonStyle” or “GhostButtonStyle” in the future.
Looking at the Win10 SDK generic.xaml, the pattern seems to be to not have named default styles at all. In the WinUI repo, the “Default[Control name]Style” pattern has been used a lot.