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

RadImageEditorUI named "ImageEditor"

2 Answers 100 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 01 Aug 2012, 04:13 PM
I've been struggling with this issue for days and thought I would post my findings in case
anyone else runs into this.  I have a RadImageEditorUI that I named "ImageEditor".  
When an image was loaded into the control, all the ImageTools were disabled. I assume this
is due to the RadImageEditorUI having a property named "
ImageEditor" as well and is conflicting
with the name of my control.  Once I renamed the control, the tools worked fine.

 

<telerik:RadImageEditorUI x:Name="ImageEditor" IsOpenButtonVisible="False">
    <telerik:RadImageEditorUI.ImageToolsSections>
        <telerik:ImageToolsSection>
            <telerik:ImageToolItem ImageKey="Rotate90CW" Text="Rotate 90"  Command="commands:ImageEditorRoutedCommands.Rotate90Clockwise"/>
            <telerik:ImageToolItem ImageKey="Rotate180CW" Text="Rotate 180"  Command="commands:ImageEditorRoutedCommands.Rotate180" />
            <telerik:ImageToolItem ImageKey="Rotate90CCW" Text="Rotate 270"  Command="commands:ImageEditorRoutedCommands.Rotate90Counterclockwise" />
            <telerik:ImageToolItem ImageKey="FlipHorizontal" Text="Flip Horizontal"  Command="commands:ImageEditorRoutedCommands.FlipHorizontal" />
            <telerik:ImageToolItem ImageKey="FlipVertical" Text="Flip Vertical"  Command="commands:ImageEditorRoutedCommands.FlipVertical" />
        </telerik:ImageToolsSection>
    </telerik:RadImageEditorUI.ImageToolsSections>
</telerik:RadImageEditorUI>

2 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 03 Aug 2012, 04:16 PM
Hi Jason,

Thank you for getting to us about this at first glance strange issue.

You have found right that if the ImageEditorUI's Name is ImageEditor, the buttons for the tools and commands of the editor will be disabled. This is caused by the fact that the Name of the ImageEditor in RadImageEditorUI's default template is exactly "ImageEditor". For some reason this results in incorrect behavior in Silverlight as if the UI tries to find the tools and commands in its own properties instead of the editor's.

This does not seem to be a bug in our code and the problem seems to be in the fact that in Silverlight the scope of the names is different than in WPF (where the same case works correctly). A Name is needed in the template, so that the binding between the ImageEditorUI and the ImageEditor can be successfully resolved and there will always be a name that results in this behavior.

Please, change the name of RadImageEditorUI to resolve the issue and let us know if you have any other comments or observations.

All the best,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mohammad Elsheimy
Top achievements
Rank 1
answered on 09 Mar 2013, 07:43 AM
2 hours of my time wasted until I found this, thank u Telerik (btw, same code works perfectly in WPF)
Tags
ImageEditor
Asked by
Jason
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Mohammad Elsheimy
Top achievements
Rank 1
Share this question
or