lepoco / lepoco/wpfui

Theme based images

Open
#1,659 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help_wanted styles themes
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.