A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
713 B

using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
namespace ControlCatalog.Pages
{
public partial class GesturePinchRotationPage : UserControl
{
private bool _isInit;
public GesturePinchRotationPage()
{
InitializeComponent();
}
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);
if (_isInit)
{
return;
}
_isInit = true;
RotationGesture.AddHandler(InputElement.PinchEvent, (s, e) =>
{
AngleSlider.Value = e.Angle;
});
}
}
}