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

RadImageEditorUI databinding doesn't work

5 Answers 101 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Enric
Top achievements
Rank 1
Enric asked on 09 Sep 2013, 09:30 PM
Hi all of you,

I'm using this control under trial license. I'm trying to do a very simple binding but it doesn't work at all:

xaml header:

Here you can see the reference to one of my RESX files (I've got one for English and another one for Spanish where every key is named alike.
Names of resources files:

MasterGIT.resx and MasterGIT.en.resx

This line uses one RESX under criteria language:

     ResxExtension.DefaultResxName="GIT_CuadroMando.MasterGIT" Language="{UICulture}"

<Window
        ResxExtension.DefaultResxName="GIT_CuadroMando.MasterGIT" Language="{UICulture}"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="GestorDocumental"
 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="Window_Loaded"
    xmlns:local="clr-namespace:GIT_CuadroMando"
    xmlns:commands="clr-namespace:Telerik.Windows.Media.Imaging.ImageEditorCommands.RoutedCommands;assembly=Telerik.Windows.Controls.ImageEditor"       
    xmlns:tools="clr-namespace:Telerik.Windows.Media.Imaging.Tools;assembly=Telerik.Windows.Controls.ImageEditor"
    Title="{Resx TitleGestorDocumental}" Height="701" Width="1000" ResizeMode="CanResize" WindowStyle="ToolWindow">


xaml stuff:
<telerik:RadImageEditorUI x:Name="BodyWorkAndPaintingTool" Grid.ColumnSpan="4" Margin="10,49,33,10" Grid.Row="1" Grid.RowSpan="4">
          <telerik:RadImageEditorUI.ImageToolsSections>
              <telerik:ImageToolsSection Header="{Resx Disenador_Blur}"  >
 
                  <telerik:ImageToolItem ImageKey="Resize" Text="Resize" Command="commands:ImageEditorRoutedCommands.ExecuteTool">
                      <telerik:ImageToolItem.CommandParameter>
                          <tools:ResizeTool x:Name="resizeTool"/>
                      </telerik:ImageToolItem.CommandParameter>
                  </telerik:ImageToolItem>
 
                  <telerik:ImageToolItem ImageKey="Resize" Text="Canvas resize" Command="commands:ImageEditorRoutedCommands.ExecuteTool">
                      <telerik:ImageToolItem.CommandParameter>
                          <tools:CanvasResizeTool/>
                      </telerik:ImageToolItem.CommandParameter>
                  </telerik:ImageToolItem>

Code-behind:


  Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)
 
        CultureManager.UICulture = Thread.CurrentThread.CurrentCulture
'        Thread.CurrentThread.CurrentUICulture = New CultureInfo("es")
 
    End Sub


Thanks in advance for any hint or advice,

5 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 12 Sep 2013, 03:16 PM
Hello,

Please refer to this help article explaining how to localize RadImageEditor. I am also attaching a simple sample project which demonstrates the explained approach. 

I hope this helps!

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Enric
Top achievements
Rank 1
answered on 12 Sep 2013, 06:47 PM
Hi Petya,

Thanks a lot, I've got it!!


0
Enric
Top achievements
Rank 1
answered on 12 Sep 2013, 08:17 PM
LocalizationManager.Manager = new LocalizationManager()
{
                ResourceManager = MasterGIT.ResourceManager
};

Above lines, could you be please so kind to translate into VB .NET?
0
Enric
Top achievements
Rank 1
answered on 12 Sep 2013, 09:18 PM
It doesn't work.

I'll try to be more clear as much I can (sorry for my english)

code-behind view (I don't know if the problem born here..
   
Public Class GestorDocumental
Public Sub New()

' Llamada necesaria para el diseñador.
InitializeComponent()
DataContext = Me
afegirimatges()

Dim m As ResourceManager
LocalizationManager.Manager() = New LocalizationManager()
 
m = MasterGIT2.ResourceManager


xaml:

          
<telerik:RadImageEditorUI.ImageToolsSections>
               <telerik:ImageToolsSection telerik:LocalizationManager.ResourceKey="Disenador_Blur"  >


ResourceMAnager class (MasterGIT.Designer.vb):

'------------------------------------------------------------------------------
' <auto-generated>
'     Este código fue generado por una herramienta.
'     Versión de runtime:4.0.30319.18052
'
'     Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
'     se vuelve a generar el código.
' </auto-generated>
'------------------------------------------------------------------------------
 
Option Strict On
Option Explicit On
 
Imports System
 
Namespace My.Resources
     
    'StronglyTypedResourceBuilder generó automáticamente esta clase
    'a través de una herramienta como ResGen o Visual Studio.
    'Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen
    'con la opción /str o vuelva a generar su proyecto de VS.
    '''<summary>
    '''  Clase de recurso con establecimiento inflexible de tipos, para buscar cadenas traducidas, etc.
    '''</summary>
    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
    Public Class MasterGIT2
 
        Private Shared resourceMan As Global.System.Resources.ResourceManager
 
        Private Shared resourceCulture As Global.System.Globalization.CultureInfo
 
        <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
        Friend Sub New()
            MyBase.New()
        End Sub
 
        '''<summary>
        '''  Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase.
        '''</summary>
        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
        Public Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
            Get
                If Object.ReferenceEquals(resourceMan, Nothing) Then
                    Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("GIT_CuadroMando.MasterGIT", GetType(MasterGIT2).Assembly)
                    resourceMan = temp
                End If
                Return resourceMan
            End Get
        End Property



0
Petya
Telerik team
answered on 17 Sep 2013, 03:20 PM
Hello,

The below code snippet you requested in VB looks like this: 
LocalizationManager.Manager = New LocalizationManager() With {.ResourceManager = MasterGIT.ResourceManager}

Generally, I am not sure what the issue on your end is and I am unable to replicate it. 

However, I can see you decided to change the Name strings in your resources. Please note that other than the ones in your pages, the same resource keys are used in the settings panels for example. That said, the predefined UI of RadImageEditorUI does not use the resource key for Reset, but changing it in the resources as explained in the referenced article would still localize it.

In case you are still facing difficulties please get back to us with a sample project which we can troubleshoot.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
General Discussions
Asked by
Enric
Top achievements
Rank 1
Answers by
Petya
Telerik team
Enric
Top achievements
Rank 1
Share this question
or