C#C
C#3y ago
1 reply
Vemsvims

❔ Change image stream runtime (WPF/XAML)

XAML
<Image Source="{Binding MyStream, BindsDirectlyToSource=True}" />

C#
[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?
Was this page helpful?