question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Control Styles should be named

See original GitHub issue

While 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
mdtaukcommented, Dec 14, 2020

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.

2reactions
chingucodingcommented, Dec 4, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found