Bug title ImageViewer 控件 ImageSource =img 无法渲染出图片

Author: ping9719Created Aug 28, 2026Updated Aug 28, 2026

Describe the bug

public class ImageWatcher : ImageWatcher
{
    public void Abc(string path1)
    {
                            using (var stream = new FileStream(path1, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                            {
                                ImageSource = BitmapFrame.Create(stream, BitmapCreateOptions.IgnoreColorProfile, BitmapCacheOption.OnLoad);
                            }
    }

}

无法显示出图片,但是直接 new ImageViewer(path1); 是可以显示出图片的

Steps to reproduce the bug

1

Expected behavior

No response

Screenshots

No response

NuGet package version

None

IDE

No response

Framework type

No response

Windows version

No response

Additional context

No response