Image is not binding properly from view model ImageSource
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
As stated in title, binding is failing to show the ImageSource properly.
To Reproduce
I am extracting an InteropBitmap from an executable file, which in and of itself is fine. But the binding is not reflected in the view control.
In my view, doing the simple thing as follows:
<ui:Image Grid.Column="2" Width="24" Height="24" Margin="2" Source="{Binding ApplicationImageSource, Mode=OneWay}" />
Nothing at all that fancy about that.
Expected behavior
This after apparently falling back on the stock WPF Image, which actually is a FrameworkElement, a UIElement.
<Image Grid.Column="2" Width="24" Height="24" Margin="2" Source="{Binding ApplicationImageSource, Mode=OneWay}" />
This "just works", not sure why yours does not. Benefit of the doubt, of course, I would like to be using yours, but I cannot today. Unless I am doing something wrong, but as shown by the image, the view model is correct, the stock element works.
Whereas Wpf.Ui.Controls.Image is a Control, which is also FrameworkElement, so not really seeing the difference there leading to my bit of chagrin, as to why this is such a perplexity.
Screenshots
Would expect something along these lines.
OS version
#n/a
.NET version
Target framework net8.0-windows
WPF-UI NuGet version
Latest 3.0
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the binding with Wpf.Ui.Controls.Image using the shown XAML and an InteropBitmap, then compare it with the stock WPF Image that works. Investigate the control's image-source binding behavior; done when ApplicationImageSource displays through Wpf.Ui.Controls.Image as it does through the stock control.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100