The following code crashes:
<navigation:Page x:Class="Designer.Ui.Silverlight.Home"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignWidth="640"
d:DesignHeight="480"
Style="{StaticResource PageStyle}">
<Grid x:Name="LayoutRoot">
<telerik:RadRichTextBox x:Name="RadRichTextBox1"
Height="440"
Width="440">
<telerik:RadRichTextBox.Document>
<telerik:RadDocument x:Name="RadDocument1" LayoutMode="Paged">
<telerik:RadDocument.DefaultPageLayoutSettings>
<telerik:PageLayoutSettings Height="400"
Width="400" />
</telerik:RadDocument.DefaultPageLayoutSettings>
<telerik:Section>
<telerik:Paragraph>
<telerik:Span>
Thank you for choosing Telerik
</telerik:Span>
</telerik:Paragraph>
</telerik:Section>
</telerik:RadDocument>
</telerik:RadRichTextBox.Document>
</telerik:RadRichTextBox>
</Grid>
</navigation:Page>
Error message:
When using code like this, it works:
Any ideas?
Thankx, Harry
<navigation:Page x:Class="Designer.Ui.Silverlight.Home"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignWidth="640"
d:DesignHeight="480"
Style="{StaticResource PageStyle}">
<Grid x:Name="LayoutRoot">
<telerik:RadRichTextBox x:Name="RadRichTextBox1"
Height="440"
Width="440">
<telerik:RadRichTextBox.Document>
<telerik:RadDocument x:Name="RadDocument1" LayoutMode="Paged">
<telerik:RadDocument.DefaultPageLayoutSettings>
<telerik:PageLayoutSettings Height="400"
Width="400" />
</telerik:RadDocument.DefaultPageLayoutSettings>
<telerik:Section>
<telerik:Paragraph>
<telerik:Span>
Thank you for choosing Telerik
</telerik:Span>
</telerik:Paragraph>
</telerik:Section>
</telerik:RadDocument>
</telerik:RadRichTextBox.Document>
</telerik:RadRichTextBox>
</Grid>
</navigation:Page>
Error message:
at System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult)
at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)
Caused by: Exception has been thrown by the target of an invocation.
at System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult)
at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)
When using code like this, it works:
RadDocument document = new RadDocument();
document.LayoutMode = DocumentLayoutMode.Paged;
document.DefaultPageLayoutSettings.Width = 400;
document.DefaultPageLayoutSettings.Height = 400;
RadRichTextBox1.Document = document;
Any ideas?
Thankx, Harry