MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
Use global SystemParameters.FocusVisualStyleKey insead of per control FocusVisual style
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 16.3k
- Forks
- 3.5k
- Ø Merge
- 1 T. 22 Std.
- Gemergte PRs (30 T.)
- 8
Beschreibung
Is your feature request related to a problem? Please describe.
A bunch of control styles define a FocusVisual style that is used as a setter value for FocusVisualStyle property and there is no way to customize them other than creating custom styles for each control and setting FocusVisualStyle to your own style.
Most of them are identical:
https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/2a38b2c70a5e851bc5b926e0641c1848e719d86b/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Button.xaml#L17-L30
Only OptionMarkFocusVisual seems to have different Margin:
https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/2a38b2c70a5e851bc5b926e0641c1848e719d86b/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.RadioButton.xaml#L13-L25
I think the FocusVisualStyle should be globally defined with SystemParameters.FocusVisualStyleKey in App.xaml:
<Style x:Key="{x:Static SystemParameters.FocusVisualStyleKey}" TargetType="Control">
<Setter Property="Control.Template">
...
</Setter>
</Style>
If Margin is all that needs to be changed for some controls then maybe a FocusVisualAssist.Margin could be added to allow those controls to have their own FocusVisualStyle:
<Style x:Key="OptionMarkFocusVisual" BasedOn="{x:Static SystemParameters.FocusVisualStyleKey}">
<Setter Property="materialDesign:FocusVisualAssist.Margin" Value="0,0,0,0"/>
</Style>
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit den FocusVisual-Definitionen in MaterialDesignTheme.Button.xaml und MaterialDesignTheme.RadioButton.xaml und untersuche anschließend die vorgeschlagene Verwendung von SystemParameters.FocusVisualStyleKey in App.xaml. Vergleiche das gemeinsame Template und den abweichenden OptionMark-Abstand und berücksichtige den vorhandenen FocusVisualAssist-Pfad. Als abgeschlossen gilt die Ersetzung oder Konsolidierung der duplizierten Stile pro Steuerelement, ohne die Darstellung des Fokus zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- design, desktop
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100