Skip to content

ImageEx.CornerRadius property not working anymore #3528

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

Closed
2 tasks done
Sergio0694 opened this issue Oct 10, 2020 · 2 comments · Fixed by #3529
Closed
2 tasks done

ImageEx.CornerRadius property not working anymore #3528

Sergio0694 opened this issue Oct 10, 2020 · 2 comments · Fixed by #3529
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior Completed 🔥 controls 🎛️
Milestone

Comments

@Sergio0694
Copy link
Member

Describe the bug

The ImageEx.CornerRadius property is no longer working.
Setting that doesn't change how the image is displayed - no matter its value the image is always just a square.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work: 6.1.1

Steps to Reproduce

  • Can this be reproduced in the Sample App?

Steps to reproduce the behavior:

  1. Clone master
  2. Build and run the sample app
  3. Go to the ImageEx sample page
  4. Notice how the image with a custom CornerRadius value are still rendered as quares

Expected behavior

Modifying CornerRadius should apply to the displayed image.

Screenshots

image

Environment

NuGet Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [X] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [X] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [X] 2019 (version: 16.7) 
- [ ] 2019 Preview (version: )

@Sergio0694 Sergio0694 added bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ labels Oct 10, 2020
@Sergio0694 Sergio0694 added this to the 7.0 milestone Oct 10, 2020
@ghost ghost added the In-PR 🚀 label Oct 10, 2020
@michael-hawker
Copy link
Member

Nice catch, thanks @Sergio0694!

Were there any other controls we were doing this on? (I'm guessing not, but could be good to check for new properties we've overridden).

@Sergio0694
Copy link
Member Author

@Sergio0694 Did a solution-wise search and didn't find anything, so I think we should be good 😄

@ghost ghost closed this as completed in #3529 Oct 15, 2020
ghost pushed a commit that referenced this issue Oct 15, 2020
## Fixes #3528 
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

- Bugfix
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
The `ImageEx.CornerRadius` property isn't working anymore.

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->
Modifying `ImageEx.CornerRadius` works correctly.

## Additional detail
With #3440, we bumped the minimum SDK to 1809 (build 17763), which is the first one with the `CornerRadius` being available in the `Control` class. I suspect building the controls package with that minimum SDK caused an issue with `ImageEx` defining the `CornerRadius` property again (using `new`), so that the XAML `TemplateBinding` ended up failing to find the correct property to bind to. It might also be because setting the property in XAML ended up setting the value for the incorrect duplicate one, so that binding was never update. Regardless, with that minimum version available there's no reason to duplicate that property in the first place, we can just use the built-in one and bind to that. This PR removes that duplicate property, fixing the issue.

> **NOTE:** this is _technically_ a breaking change as we're removing a public property, but users should effectively not really notice any difference, unless they were for some reason setting that very specific property through reflection, which is highly unlikely. Adding the tag for correctness, since this is still in fact a breaking change. Not likely to be noticed though 😄

## PR Checklist

Please check if your PR fulfills the following requirements:

- [X] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] ~~Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->~~
- [ ] ~~Sample in sample app has been added / updated (for bug fixes / features)~~
    - [ ] ~~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)~~
- [X] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [ ] Contains **NO** breaking changes
@ghost ghost added Completed 🔥 and removed In-PR 🚀 labels Oct 15, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 14, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior Completed 🔥 controls 🎛️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants