MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
Use global SystemParameters.FocusVisualStyleKey insead of per control FocusVisual style
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 16.3k
- Fork
- 3.5k
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 8
Mô tả
**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"/>
```
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với các định nghĩa FocusVisual trong MaterialDesignTheme.Button.xaml và MaterialDesignTheme.RadioButton.xaml, sau đó kiểm tra cách sử dụng SystemParameters.FocusVisualStyleKey được đề xuất trong App.xaml. So sánh template dùng chung và margin khác nhau của OptionMark, đồng thời xem xét đường dẫn FocusVisualAssist hiện có. Hoàn tất khi các style trùng lặp theo từng control được thay thế hoặc hợp nhất mà không thay đổi cách hiển thị focus.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp
- Lĩnh vực
- design, desktop
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100