MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
Use global SystemParameters.FocusVisualStyleKey insead of per control FocusVisual style
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 16.3k
- Forks
- 3.5k
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 8
Descripción
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>
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con las definiciones de FocusVisual en MaterialDesignTheme.Button.xaml y MaterialDesignTheme.RadioButton.xaml; después, inspecciona el uso propuesto de SystemParameters.FocusVisualStyleKey en App.xaml. Compara la plantilla compartida y el margen diferente de OptionMark, y considera la ruta existente de FocusVisualAssist. Se considera terminado cuando los estilos duplicados por control se hayan reemplazado o consolidado sin cambiar la representación del foco.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- design, desktop
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100