Articles in this section
Category / Section

How to avoid crop sluggishness in MasterDetailPage?

1 min read

This section will explain how to avoid crop sluggishness when add image editor inside MasterDetailPage in iOS platform. The reason for crop sluggishness, when  resize the cropping panel in ImageEditor which in turn enables the parent gesture (MasterDetail page Gesture). This is the default behavior of MasterDetail Page behavior in iOS. That is, when perform any interaction such as swipe or move for MasterDetail Page’s children view will also triggers the MasterDetailPage gesture. 

 

Step 1: Create Master Detail page image editor sample with all necessary assemblies and add desired image in sample. Select Crop toolbar menu item to display the cropping panel on image and then resize the crop handle from left corner.Crop sluggishness  will occur.

 

Step 2: To avoid crop sluggishness, you need to disable the Master Detail Page Gesture   when loading the ImageEditor in OnAppearing method as like following code snippet.

 

protected override void OnAppearing()
        {
            base.OnAppearing();
            if((Device.RuntimePlatform == Device.iOS))
                (Application.Current.MainPage as ImageEditorPage).IsGestureEnabled = false;
        }

 

 

Step 3: To Enable the Master Detail Page Gesture when navigate back from the Image Editor , you need to set GestureEnabled  property to true  in OnDisappearing method   as like below code snippet

 

protected override void OnDisappearing()
        {
            base.OnDisappearing();
            if ((Device.RuntimePlatform == Device.iOS))
                (Application.Current.MainPage as ImageEditorPage).IsGestureEnabled = true;
        }

 

 

Sample Link:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/IMAGEE~1-1561128314.zip

 

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied