8000 Aspect Ratio: Add implicit converter for integer by XAML-Knight · Pull Request #4321 · CommunityToolkit/WindowsCommunityToolkit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Aspect Ratio: Add implicit converter for integer #4321

New issue

Have a question about this project? Sign up for a free GitHub account 8000 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

Merged

Conversation

XAML-Knight
Copy link
Contributor

Fixes #4241

PR Type

If you try and bind an int value to the AspectRatio of the ConstrainedBox then it won't convert as it can't cast it to double... Should provide implicit converters for int in addition to double to help this scenario where you want a N:1 aspect ratio, where N is an int.

What is the new behavior?

Bind to an integer value and have it converted to an Aspect Ratio correctly.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • New component
    • Pull Request has been submitted to the documentation repository instructions. Link:
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
    • If control, added to Visual Studio Design project
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

Also, #4307

@ghost
Copy link
ghost commented Oct 14, 2021

Thanks XAML-Knight for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from michael-hawker and azchohfi October 14, 2021 18:42
@ghost ghost added the bug 🐛 An unexpected issue that highlights incorrect behavior label Oct 14, 2021
@michael-hawker michael-hawker added this to the 7.1.1 milestone Oct 14, 2021
<Project>{84ab7dc5-95c9-4cf8-a370-d077e9e9ef1a}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Primitives</Name>
</ProjectReference>
<ProjectReference Include="..\..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj">
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't need the controls package here as it just contains all the other packages (it has nothing in it itself).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

@michael-hawker michael-hawker merged commit 7113a60 into CommunityToolkit:main Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't x:Bind an int to AspectRatio
2 participants
0