Skip to content

Commit

Permalink
Revert "[Windows] Allow to refresh the RefreshView using the mouse (#…
Browse files Browse the repository at this point in the history
…14261) Fixes #6404"

This reverts commit 0ba7058.
  • Loading branch information
rachelkang committed Jul 12, 2023
1 parent 291a356 commit 9d78a1f
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,16 @@ public partial class RefreshViewHandler : ViewHandler<IRefreshView, RefreshConta

protected override RefreshContainer CreatePlatformView()
{
var refreshContainer = new RefreshContainer
return new RefreshContainer
{
ManipulationMode = UI.Xaml.Input.ManipulationModes.All,
PullDirection = RefreshPullDirection.TopToBottom
};

return refreshContainer;
}

protected override void ConnectHandler(RefreshContainer nativeView)
{
nativeView.Loaded += OnLoaded;
nativeView.RefreshRequested += OnRefresh;
nativeView.ManipulationDelta += OnManipulationDelta;

base.ConnectHandler(nativeView);
}
Expand All @@ -36,7 +32,6 @@ protected override void DisconnectHandler(RefreshContainer nativeView)
{
nativeView.Loaded -= OnLoaded;
nativeView.RefreshRequested -= OnRefresh;
nativeView.ManipulationDelta += OnManipulationDelta;

CompleteRefresh();

Expand Down Expand Up @@ -119,18 +114,6 @@ void OnRefresh(object sender, RefreshRequestedEventArgs args)
VirtualView.IsRefreshing = true;
}

void OnManipulationDelta(object sender, UI.Xaml.Input.ManipulationDeltaRoutedEventArgs e)
{
if (e.PointerDeviceType is UI.Input.PointerDeviceType.Touch)
return; // Already managed by the RefreshContainer control itself

const double minimumCumulativeY = 20;
double cumulativeY = e.Cumulative.Translation.Y;

if (cumulativeY > minimumCumulativeY && VirtualView is not null && !VirtualView.IsRefreshing)
VirtualView.IsRefreshing = true;
}

void CompleteRefresh()
{
if (_refreshCompletionDeferral != null)
Expand Down

0 comments on commit 9d78a1f

Please sign in to comment.