Theme based images
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe
I have a company logo that is not visible using the dark theme. Is it possible to change the image based on which theme is used?
Describe the solution you'd like
Ideal usage would be something like...
<Image Style="{ThemedResource CompanyLogo}" Width="200" HorizontalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality"/>
Describe alternatives you've considered
I have tried implementing something using resource dictionaries, but I wasn't able to get it to work.
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" >
<ResourceDictionary x:Key="Light">
<Style x:Key="CompanyLogo" TargetType="Image">
<Setter Property="Source" Value="/Assets/CompanyLogo_Blue.png"/>
</Style>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<Style x:Key="CompanyLogo" TargetType="Image">
<Setter Property="Source" Value="/Assets/CompanyLogo_White.png"/>
</Style>
</ResourceDictionary>
</ui:ThemesDictionary>
<ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
Additional context
No response
Contributor guide
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
The issue provides no file or test references. Start by locating WPF UI theme and resource-dictionary handling, then determine how theme changes could select different image resources. Done means the requested light/dark image scenario works and is covered by an appropriate test or example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100