Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToggleSwitch HC Colour Fix #4043

Merged
merged 2 commits into from
Jan 28, 2021
Merged

ToggleSwitch HC Colour Fix #4043

merged 2 commits into from
Jan 28, 2021

Conversation

karkarl
Copy link
Contributor

@karkarl karkarl commented Jan 27, 2021

Description

  • Point certain HC Resources used in ColorTransition to colour

Motivation and Context

Fixes internal issue 31455320

How Has This Been Tested?

Visual verification

Screenshots (if appropriate):

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jan 27, 2021
@karkarl
Copy link
Contributor Author

karkarl commented Jan 27, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj ranjeshj added area-ToggleSwitch team-Controls Issue for the Controls team area-Styling and removed needs-triage Issue needs to be triaged by the area owners labels Jan 27, 2021
<StaticResource x:Key="ToggleSwitchStrokeOffPointerOver" ResourceKey="SystemControlHighlightBaseMediumHighBrush" />
<StaticResource x:Key="ToggleSwitchStrokeOffPressed" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ToggleSwitchStrokeOffDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ToggleSwitchStrokeOffPointerOver" ResourceKey="SystemColorHighlightColor" />
Copy link
Contributor

@tashatitova tashatitova Jan 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work this way? I thought ResourceKey works for brushes? That it'd need to be SolidColorBrush pointing to ThemeResource SystemColorHighlightColor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to point it to a colour instead, since ColorAnimations' TargetProperty only takes colour. When the resource was a brush, it was causing the elements to completely disappear. The only other option would be to remove ColorAnimations completely :(

Copy link
Contributor

@tashatitova tashatitova Jan 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I understand why you're doing this, I just don't think I've seen a system high contrast color referenced through ResourceKey like this. Creating a SolidColorBrush would definitely work though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This similar to the workaround we did for other controls, where instead of referencing the brush, we reference the colour that brush was pointing to originally. The updated colour here is what the HC brushes are pointing to. The referenced colours can be looked up on the internal tool.

@ranjeshj
Copy link
Contributor

please merge in master

@beervoley
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj ranjeshj merged commit a146dd3 into master Jan 28, 2021
@ranjeshj ranjeshj deleted the user/karenlai/ToggleSwitchHCFix branch January 28, 2021 13:10
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Nov 9, 2022
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants