MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

Use global SystemParameters.FocusVisualStyleKey insead of per control FocusVisual style

オープン
#2,976 コメント 16 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
C#
スター
16.3k
フォーク
3.5k
平均マージ
1日 22時間
マージ済み PR(30日)
8

説明

**Is your feature request related to a problem? Please describe.**
A [bunch](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/search?q=FocusVisual) 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:
```xaml

<Setter Property="Control.Template">
...
</Setter>

```

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`:
```xaml

<Setter Property="materialDesign:FocusVisualAssist.Margin" Value="0,0,0,0"/>

```

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず MaterialDesignTheme.Button.xaml と MaterialDesignTheme.RadioButton.xaml の FocusVisual 定義から始め、次に App.xaml で提案されている SystemParameters.FocusVisualStyleKey の使用方法を調べます。共有テンプレートと異なる OptionMark のマージンを比較し、既存の FocusVisualAssist パスを考慮します。コントロールごとに重複しているスタイルを、フォーカスの描画を変更せずに置き換えるか統合できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp
領域
design, desktop
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。