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

RichTextBox crashes when editting images with the Windows8 theme

7 Answers 164 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
DKO
Top achievements
Rank 1
DKO asked on 25 Apr 2018, 09:26 AM

Hello,

We're using the RadRichTextBox control with the Windows8 Theme.
And it's possible to insert an image in the text but as soon as the user tries to select this image to resize it, the application crashes:

An unhandled exception of type 'System.NullReferenceException' occurred in PresentationFramework.dll

At first I thought we were doing something wrong, so I've tried to recreate the problem in one the the sample projects.
By doing so I've noticed that this problem occurs only when using the Windows8 Theme. Changing the theme to Windows7 for example makes the issue disappear. But this is not an actual solution for us, because we'd like to be able to use the Windows8 theme too.

I've attached a screenshot of the exception details. I apologise for it being in Dutch but I believe it still to be of use here.
It says that the resource key RadButtonStyle is missing. I'd like to point out again that this seems to only occur with the Windows8 theme.

To recreate the problem you can use the SaveAndSaveAs_WPF sample project and just set the theme of the RadRichTextBox control to Windows8.
You can just take a screenshot and paste it in the RadRichTextBox, when you try to resize this image the NullReferenceException should be thrown.
Below is an example of the adjusted MainWindow.xaml:

<Window x:Class="SaveAndSaveAs_WPF.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0" >
            <telerik:RadButton  Content="New" Click="NewDocumentButton_Click" Padding="25,5" Margin="5" />
            <telerik:RadButton  Content="Open" Click="OpenButton_Click" Padding="25,5" Margin="5" />
            <telerik:RadButton  Content="Save" Click="SaveButton_Click"  Margin="5" Padding="25,5"/>
            <telerik:RadButton  Content="Save As" Click="SaveAsButton_Click"  Margin="5" Padding="25,5"/>
        </StackPanel>
        <telerik:DocumentRuler Grid.Row="1">
            <telerik:RadRichTextBox
                    telerik:Analytics.Name="rtb"
                    x:Name="radRichTextBox"
                    IsSpellCheckingEnabled="False"
                    LayoutMode="Paged"
                    AllowDrop="True" >
                <telerik:RadRichTextBox.Style>
                    <Style TargetType="telerik:RadRichTextBox">
                        <Setter Property="telerik:StyleManager.Theme" Value="Windows8" />
                    </Style>
                </telerik:RadRichTextBox.Style>
            </telerik:RadRichTextBox>
        </telerik:DocumentRuler>
    </Grid>
</Window>

 

Is there anything we could to in order to bypass this problem and still use the Windows8 theme?

 

7 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 30 Apr 2018, 09:00 AM
Hi,

This is the first time we receive such a report and I made several tests of the functionality. On our end everything seems to be working as expected both in a sample application and in the Save and Save As SDK demo. I am attaching a video showing how I am testing. Could you please check it and let me know if I am missing something?

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
DKO
Top achievements
Rank 1
answered on 03 May 2018, 09:36 AM

[quote]Tanya said:Hi,

This is the first time we receive such a report and I made several tests of the functionality. On our end everything seems to be working as expected both in a sample application and in the Save and Save As SDK demo. I am attaching a video showing how I am testing. Could you please check it and let me know if I am missing something?

Regards,
Tanya
Progress Telerik[/quote]

The video you've attached only shows 1 static screen, nothing else happens.
In that single image I can tell you've set your theme differently than I did.

So I've tried your way of setting it, and the same error still persists.

Unfortunately I can't tell if you're doing anything wrong in your video because it doesn't play for me.
Just pasting an image from clipboard inside the RichTextBox works. But when I try to resize it by dragging on a corner, the application crashes.

 

0
DKO
Top achievements
Rank 1
answered on 03 May 2018, 09:56 AM
[quote]DKO said:

[quote]Tanya said:Hi,

This is the first time we receive such a report and I made several tests of the functionality. On our end everything seems to be working as expected both in a sample application and in the Save and Save As SDK demo. I am attaching a video showing how I am testing. Could you please check it and let me know if I am missing something?

Regards,
Tanya
Progress Telerik[/quote]

The video you've attached only shows 1 static screen, nothing else happens.
In that single image I can tell you've set your theme differently than I did.

So I've tried your way of setting it, and the same error still persists.

Unfortunately I can't tell if you're doing anything wrong in your video because it doesn't play for me.
Just pasting an image from clipboard inside the RichTextBox works. But when I try to resize it by dragging on a corner, the application crashes.

[/quote]

 

Just ignore this post, I've managed to play the video. For some reason it didn't play using VLC.

The only difference between my way of testing it and what you've showed, is that I add an image with Ctrl + V
Could you maybe attach your sample project?

0
Tanya
Telerik team
answered on 08 May 2018, 08:31 AM
Hi,

You can play the attached videos using your web browser.

I tested pasting the image inside the control and resizing it and it still behaves as expected. To ensure I am testing the same case, I used the Save and Save As SDK example with the different theme. I am sharing the project attached to this reply. In the archive, you will also find a video demonstrating how I perform the test. Please, let me know if I am doing something wrong. Could you please confirm that you are using the latest version of the control? 

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
DKO
Top achievements
Rank 1
answered on 08 May 2018, 08:58 AM

Unfortunately we do not own the latest version.

Our current version is: 2016.2.613.45

I've noticed there is 1 newer version that we have access to:  2016.3.1024.45
So I'll try and update to that version and see if the problem still persists.

If we want to get the newest version than it states that we will receive the trial version.

0
DKO
Top achievements
Rank 1
answered on 08 May 2018, 11:25 AM
[quote]DKO said:

Unfortunately we do not own the latest version.

Our current version is: 2016.2.613.45

I've noticed there is 1 newer version that we have access to:  2016.3.1024.45
So I'll try and update to that version and see if the problem still persists.

If we want to get the newest version than it states that we will receive the trial version.

[/quote]

After updating to version 2016.3.1024.45, the same problem still persists.

The action you perform in your video is the thing that causes the application to crash for me.
When I launched your project, all of the references were broken so I changed them to work with our version.
After doing this the application still crashed for me.

So I decided to try the trial version of the newest release (2018.1.220.45) and of course everything works now.
This means that my issue got fixed in one of the updates, but unfortunately we can't use the trial version for our application.
Is it possible to get the fix without having to buy a new license? Or is this the only way to get this problem resolved?

0
Accepted
Tanya
Telerik team
answered on 11 May 2018, 07:09 AM
Hello,

The fixes in a control are integrated only with the current version and not with previous ones. Thus, I am afraid that we cannot provide you with a fix for the currently used version of UI for  WPF.

I checked the behavior with the 2016.2.613.45 version and was able to reproduce the error on our side as well. I also searched for an item in our backlog that should be logged when working on a particular fix but such doesn't exist. So, I suppose that this behavior might be fixed as a side effect of another fix. However, since the logic is inside the dll, what I could suggest as a workaround is to use the NoXaml binaries instead of StyleManager. What you will need to do is to change the references to point to the ones in the NoXaml folder and merge the resources required for the application. I am attaching a modified example showing how to achieve this. You might also find helpful to check the Xaml vs NoXaml and Implicit Styles topics that describe this mechanism of styling.

Hope that this is helpful.

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
RichTextBox
Asked by
DKO
Top achievements
Rank 1
Answers by
Tanya
Telerik team
DKO
Top achievements
Rank 1
Share this question
or