This is a migrated thread and some comments may be shown as answers.

Cancel/Save event for tools inside ImageEditor

2 Answers 38 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Victor
Top achievements
Rank 1
Victor asked on 02 Aug 2014, 01:35 PM
Hi,
Is it possible to catch events: Save/Cancel for Tools(Contrast, Crop and etc) not for ImageEditor component. As I understand there is two step flow:
1. User select tool for example Contrast, then click save button to accept changes for this particular tool
2. User click final save for ImageEditor.

I'm trying to find the events for 1 step to log it. I need the result values of each tools that user is used. 

Any Ideas?

-Victor

2 Answers, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 06 Aug 2014, 03:40 PM
Hi Victor,

While this is not directly supported, here is how you can approach it: wire the Tap event and use the following code:

protected void imageEditor_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
    var parent = ElementTreeHelper.FindVisualAncestor<RadImageButton>(e.OriginalSource as FrameworkElement);
 
    if (parent.Name == "PART_AcceptButton")
    {
        this.currentTool = (sender as RadImageEditor).CurrentTool;
        // Log current tool: Accepted
    }
    else if (parent.Name == "PART_CancelButton")
    {
        // Log current tool: Canceled
    }
    else
    {
        this.currentTool = (sender as RadImageEditor).CurrentTool;
    }
}

Note, that on Cancel, ImageEditor.CurrentTool is cleared, so you need to cache it as shown above.


Best regards,
Ves
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Victor
Top achievements
Rank 1
answered on 11 Aug 2014, 12:20 PM
Thanks
Tags
ImageEditor
Asked by
Victor
Top achievements
Rank 1
Answers by
Ves
Telerik team
Victor
Top achievements
Rank 1
Share this question
or