Hi,
I would like to load images dynamically to the RadImageEditor but the image is not displaying.
The image was passed from another module then it will convert into an image.
CONVERTER:
Can anyone help me?
Thanks,
Cielo
I would like to load images dynamically to the RadImageEditor but the image is not displaying.
The image was passed from another module then it will convert into an image.
<
telerik:RadImageEditorUI Margin="0" Name="RadImageEditorUI1" Image="{Binding ImagePath, Converter={StaticResource ImageConverter}}" SaveCommand="{Binding SaveImageCommand}">
CONVERTER:
Namespace
Converter
Public
Class
ImagesConverter
Implements
IValueConverter
Private
Shared
ImageFolder
As
String
=
"Images/"
Public
Function
Convert(value
As
Object
, targetType
As
System.Type, parameter
As
Object
, culture
As
System.Globalization.CultureInfo)
As
Object
Implements
System.Windows.Data.IValueConverter.Convert
Dim
img
As
New
BitmapImage()
Dim
imageEditor
As
New
RadImageEditor
If
Not
value
Is
Nothing
Then
'value = "EGS14272012143526640.png"
img.UriSource =
New
Uri(ImageFolder & value.ToString, UriKind.Relative)
Else
Return
Nothing
End
If
Return
img
End
Function
Public
Function
ConvertBack(value
As
Object
, targetType
As
System.Type, parameter
As
Object
, culture
As
System.Globalization.CultureInfo)
As
Object
Implements
System.Windows.Data.IValueConverter.ConvertBack
End
Function
End
Class
End
Namespace
Can anyone help me?
Thanks,
Cielo