The problem boils down to the RadRichTextBox crashing as soon as you try to use an image loaded from an invalid URL. The sample code below should reproduce it. This is quite serious because it takes down the entire application.
MainWindow.xaml:
<Window x:Class="TelerikWPFEditorTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Documents"
Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
<Grid>
<Controls:RadRichTextBox Grid.Row="1" x:Name="editor" IsSpellCheckingEnabled="False" BorderThickness="0" />
</Grid>
</Window>
MainWindow.xaml.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Documents.FormatProviders.Html;
namespace TelerikWPFEditorTest
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
HtmlFormatProvider provider = new HtmlFormatProvider();
var doc = provider.Import("<html><body><h1>test</h1><p><img src=\"http://foo.bar.com/332423432.jpg\"</p></body></html");
editor.Document = doc;
}
}
}
MainWindow.xaml:
<Window x:Class="TelerikWPFEditorTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Documents"
Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
<Grid>
<Controls:RadRichTextBox Grid.Row="1" x:Name="editor" IsSpellCheckingEnabled="False" BorderThickness="0" />
</Grid>
</Window>
MainWindow.xaml.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Documents.FormatProviders.Html;
namespace TelerikWPFEditorTest
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
HtmlFormatProvider provider = new HtmlFormatProvider();
var doc = provider.Import("<html><body><h1>test</h1><p><img src=\"http://foo.bar.com/332423432.jpg\"</p></body></html");
editor.Document = doc;
}
}
}