Vemsvims
Vemsvims
CC#
Created by Vemsvims on 3/23/2023 in #help
❔ 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?
2 replies