Cancel/Save event for tools inside ImageEditor

3 posts, 1 answers
  1. Victor
    Victor avatar
    25 posts
    Member since:
    May 2014

    Posted 02 Aug 2014 Link to this post

    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. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 06 Aug 2014 Link to this post

    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.

     
  3. DevCraft banner
  4. Victor
    Victor avatar
    25 posts
    Member since:
    May 2014

    Posted 11 Aug 2014 in reply to Ves Link to this post

    Thanks
Back to Top