C
C#2y ago
Vemsvims

❔ Change image stream runtime (WPF/XAML)

XAML
<Image Source="{Binding MyStream, BindsDirectlyToSource=True}" />
<Image Source="{Binding MyStream, BindsDirectlyToSource=True}" />
C#
[ObservableProperty]
private Stream _myStream = File.ReadAllBytes(@"C:\test.bmp").AsStream();
[ObservableProperty]
private Stream _myStream = File.ReadAllBytes(@"C:\test.bmp").AsStream();
Image shows at app start. Nice! If I set MyStream with a new image stream its OnPropertyChanged is raised. Nice! However, the initial image persists. How come it doesn't update to the new one?
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server