HandyOrg / HandyOrg/HandyControl
[Feature request] 希望能不覆盖wpf自带控件的默认样式(Hope it not apply style for controls from wpf by default)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.2k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
若在app.xaml中引用了handycontrol的资源字典,则应用程序中所有的控件,包括wpf自带的控件,全都会应用上handycontrol的样式,但这样不行,因为我需要保留其他部分原有的样式,而在每个用到handycontrol中的控件的地方分别引用资源字典又很麻烦。
If I merge the Theme.xaml to my App.xaml, all controls in my application, including controls from wpf, will apply the new style. But I dont want this, most controls should keep the original style. Though merging the Theme.xaml respectively where I use the controls in HandyControl is troublesome, too.
Describe the solution you'd like
希望将Theme.xaml拆分,把针对wpf自带控件的默认样式(如<Style BasedOn="{StaticResource ButtonDefault}" TargetType="Button" />)放入另一个资源字典中(如ThemeDefault.xaml),新增一个资源字典(如ThemeNoDefault.xaml),存放原Theme.xaml中其余的部分。然后Theme.xaml再引用这两个资源字典,这样既不影响现有的功能,又能只引用ThemeNoDefault.xaml来避免覆盖默认样式。
I hope to split the styles in Theme.xaml to ThemeDefault.xaml and ThemeNoDefault.xaml, and Theme.xaml merges these two. Then it will not affect the existing use of Theme.xaml, and can avoid overriding the default styles from wpf if I only refer the ThemeNoDefault.xaml.
我看到Theme.xaml是通过合并很多个单独的资源字典得到的,要实现上述目的得把合并前的资源字典拆分,然后执行两次合并操作,有点麻烦,但是是可以实现的
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Theme.xaml and the individual resource dictionaries it merges. Separate the WPF default-control styles from the remaining HandyControl resources, then verify that Theme.xaml still provides the existing behavior while a no-default dictionary avoids overriding WPF control styles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100