RadImageEditorUI named "ImageEditor"

3 posts, 0 answers
  1. Jason
    Jason avatar
    1 posts
    Member since:
    May 2012

    Posted 01 Aug 2012 Link to this post

    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. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 03 Aug 2012 Link to this post

    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.

  3. DevCraft banner
  4. Mohammad Elsheimy
    Mohammad Elsheimy avatar
    1 posts
    Member since:
    Oct 2012

    Posted 09 Mar 2013 Link to this post

    2 hours of my time wasted until I found this, thank u Telerik (btw, same code works perfectly in WPF)
Back to Top