修复 ImageViewer.Source 设置为null会报错的问题
修复 https://github.com/irihitech/Ursa.Avalonia/issues/680
This commit is contained in:
@@ -8,4 +8,19 @@ public partial class ImageViewerDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
Avalonia.Media.IImage? oldImg;
|
||||
|
||||
private void Button_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
{
|
||||
if(viewer.Source!=null)
|
||||
{
|
||||
oldImg = viewer.Source;
|
||||
viewer.Source = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewer.Source = oldImg;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user