Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [WPF]ImageButton with source from resource throw System.InvalidOperationException #8038

Closed
pardont opened this issue Oct 16, 2019 · 3 comments · Fixed by #9154
Closed
Labels
a/imagebutton help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often in-progress This issue has an associated pull request that may resolve it! p/WPF s/unverified New report that has yet to be verified t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@pardont
Copy link

pardont commented Oct 16, 2019

TestWpfImageButton.zip

#8025 # Description
Set ImageButton.Source with ImageSource from resource in page constructor on WPF platform, System.InvalidOperationException will be throwed when page apprearing.

Steps to Reproduce

  1. add ImageButton to page xaml
  2. set ImageButton.Source = ImageSource.FromResource("") in page constructor.
  3. run and show the page.

Basic Information

  • Xamarin.Forms: 4.3.0.851321-pre3
  • Xamarin.Forms.Platform.WPF: 4.3.0.851321-pre3
  • IDE: vs2017 or vs2019

CODE:
xaml
<ImageButton x:Name="btnResx" />

cs
public MainPage() { InitializeComponent(); btnResx.Source = ImageSource.FromResource("TestWpfImageButton.cat.png"); }

Attached is the solution source code.

@pardont pardont added s/unverified New report that has yet to be verified t/bug 🐛 labels Oct 16, 2019
@samhouts samhouts added help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Oct 17, 2019
@kingces95
Copy link
Contributor

I get a cat on master. Is launching the reproduction supposed to crash?
image

@kingces95 kingces95 added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Oct 18, 2019
@pardont
Copy link
Author

pardont commented Nov 11, 2019

@kingces95 I test it with version 4.4.0.936621-pre1, the exception always exist on WPF.
image

@pardont
Copy link
Author

pardont commented Jan 8, 2020

@kingces95 please use this code to test.
TestWpfImageButton.zip

the exception screenshot:
image

@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Jan 10, 2020
@samhouts samhouts added a/imagebutton and removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. labels Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/imagebutton help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often in-progress This issue has an associated pull request that may resolve it! p/WPF s/unverified New report that has yet to be verified t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants