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

Problems with RadImageEditor in RadModalWindow

1 Answer 37 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kiril
Top achievements
Rank 1
Kiril asked on 08 Dec 2013, 08:27 PM

Hi All,


I'm trying to show RadImageEditor in a RadModalWindow, however after the modal window get opened the image (ImageEditor's Source) is initially not visible.



However if you use the HueTool and update the image appears.



This is the XAML of my test solution:



<Grid x:Name="LayoutRoot" Background="Transparent">
    
    <Button Grid.Row="1" Click="OnButton" Width="300" Height="100" Content="Press me"/>
     
    <telerikPrimitives:RadModalWindow 
        x:Name="RadModalWindow"
        IsFullScreen="True"
         Placement = "CenterCenter"
         HorizontalAlignment="Stretch"
        HorizontalContentAlignment="Stretch"
        VerticalAlignment="Stretch"
        VerticalContentAlignment="Stretch"
        Background="BlueViolet">
         
        <Grid >
            <telerikImageEditor:RadImageEditor x:Name="ImageEditor"
                                               VerticalAlignment="Stretch"
                                               HorizontalContentAlignment="Stretch"
                                               VerticalContentAlignment="Stretch"
                                               HorizontalAlignment="Stretch" >                   
                
                <telerikImageEditor:HueTool/>
                
            </telerikImageEditor:RadImageEditor>
        </Grid>
    </telerikPrimitives:RadModalWindow>
</Grid>


And this is the code behind



public partial class MainPage : PhoneApplicationPage
   {      
       public MainPage()
       {
           InitializeComponent();
       }
       private void OnButton(object sender, RoutedEventArgs e)
       {
           var task = new PhotoChooserTask();
           task.Completed += task_Completed;
           task.ShowCamera = true;
           task.Show();
       }
 
       private void task_Completed(object sender, PhotoResult e)
       {
           var image = new BitmapImage();
           image.SetSource(e.ChosenPhoto);
 
           RadModalWindow.IsOpen = true;
           ImageEditor.Source = image;                
       }
   }






Thanks






1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 12 Dec 2013, 08:35 AM
Hi Kiril,
This is unexpected. I've logged it in our backlog and we'll investigate for a possible fix. In the meantime, you can try the following workaround:

private void task_Completed(object sender, PhotoResult e)
{
    var image = new BitmapImage();
    image.SetSource(e.ChosenPhoto);
 
    RadModalWindow.IsOpen = true;
    this.Dispatcher.BeginInvoke(() =>
    {
        ImageEditor.Source = image;
    });
}

Let us know if it works for you.

Regards,
Kiril Stanoev
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
ImageEditor
Asked by
Kiril
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or