Problems with RadImageEditor in RadModalWindow

2 posts, 0 answers
  1. Kiril
    Kiril avatar
    1 posts
    Member since:
    Nov 2012

    Posted 08 Dec 2013 Link to this post

    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






  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 12 Dec 2013 Link to this post

    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.
  3. DevCraft banner
Back to Top