Files
Ursa.Avalonia/demo/Ursa.Demo/Pages/ImageViewerDemo.axaml.cs

26 lines
508 B
C#

using Avalonia.Controls;
namespace Ursa.Demo.Pages;
public partial class ImageViewerDemo : UserControl
{
public ImageViewerDemo()
{
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;
}
}
}