This question is locked. New answers and comments are not allowed.
I have the following serialization created from my xaml code using XamlFormatProvider
and when i try to get the document from it again I get the following exception:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E)
Timestamp: Thu, 18 Nov 2010 10:08:51 UTC
Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.TypeInitializationException: The type initializer for 'Telerik.Windows.Documents.Layout.RadTextMeasurer' threw an exception. ---> System.UnauthorizedAccessException: Invalid cross-thread access.
at MS.Internal.XcpImports.CheckThread()
at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex, IntPtr constructDO)
at System.Windows.Controls.TextBlock..ctor()
at Telerik.Windows.Documents.Layout.RadTextMeasurer.InitializeMeasureBlock()
at Telerik.Windows.Documents.Layout.RadTextMeasurer..cctor()
--- End of inner exception stack trace ---
at Telerik.Windows.Documents.Layout.RadTextMeasurer.Measure(String text, Span span)
at Telerik.Windows.Documents.Layout.SpanLayoutBox.MeasureTextOverride()
at Telerik.Windows.Documents.Layout.SpanLayoutBox.MeasureText()
at Telerik.Windows.Documents.Layout.SpanLayoutBox.MeasureOverride(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
at Telerik.Windows.Documents.Layout.ParagraphLayoutBox.MeasureOverride(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
at Telerik.Windows.Documents.Layout.SectionLayoutBox.MeasureOverride(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.Arrange(RectangleF finalRect)
at Telerik.Windows.Documents.Layout.DocumentLayoutBox.ArrangeTask.ArrangeCallback(Object state)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Line: 56
Char: 13
Code: 0
URI: http://localhost:55603/SilverlightApplication6TestPage.aspx
Is InlineUIContainer supported for serialization or not? Is there a way to have only a few paragraphs or spans editable where others are not?
Thanks
<t:RadDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:t="clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents" version="1.0" DefaultPageLayoutSettings="816,1056" LayoutMode="Paged" PageViewMargin="10,10" ParagraphDefaultSpacingAfter="10" SectionDefaultPageMargin="95,95,95,95"> <t:Section PageMargin="96,96,96,96"> <t:Paragraph SpacingAfter="6.66666650772095" SpacingBefore="6.66666650772095"> <t:Span FontFamily="Calibri" FontWeight="Bold" Text="Title." /> </t:Paragraph> <t:Paragraph SpacingAfter="6.66666650772095" SpacingBefore="6.66666650772095"> <t:Span FontFamily="Calibri" Text="text text text " /><telerik:InlineUIContainer xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="20" Style="{x:Null}" Width="80" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> <telerik:InlineUIContainer.DefaultStyleSettings> <Telerik_Windows_Documents_Model_Styles_Telerik_Windows_Documents:StyleDefinition BasedOn="{x:Null}" xmlns:Telerik_Windows_Documents_Model_Styles_Telerik_Windows_Documents="clr-namespace:Telerik.Windows.Documents.Model.Styles;assembly=Telerik.Windows.Documents" /> </telerik:InlineUIContainer.DefaultStyleSettings> <Button Content="Fulano de Tal" FontSize="12" Height="30" HorizontalAlignment="Center" Margin="0,0,0,0" Tag="ID|... width = numcaracteres * 8" VerticalAlignment="Bottom" Width="80"> <Button.Background> <SolidColorBrush Color="#00FFFFFF" /> </Button.Background> <Button.Foreground> <SolidColorBrush Color="#FFFF0000" /> </Button.Foreground> <Button.Style> <Style BasedOn="{x:Null}" TargetType="Button"> <Setter Property="Foreground"> <Setter.Value> <SolidColorBrush Color="#FF000000" /> </Setter.Value> </Setter> <Setter Property="Padding"> <Setter.Value> <Thickness>0,0,0,0</Thickness> </Setter.Value> </Setter> <Setter Property="BorderThickness"> <Setter.Value> <Thickness>0,0,0,0</Thickness> </Setter.Value> </Setter> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid Margin="0,0,0,0"> <Border x:Name="Background" Background="{x:Null}" BorderThickness="0,0,0,1" CornerRadius="0,0,0,0"> <Border.BorderBrush> <SolidColorBrush Color="#FFFF0000" /> </Border.BorderBrush> <Grid Background="{x:Null}" Margin="0,0,0,0"> <Border x:Name="BackgroundAnimation" Child="{x:Null}" Opacity="0"> <Border.Background> <SolidColorBrush Color="#FF448DCA" /> </Border.Background> </Border> </Grid> </Border> <ContentPresenter x:Name="contentPresenter" Content="{x:Null}" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Bottom" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" Storyboard="{x:Null}" /> <VisualState x:Name="MouseOver" Storyboard="{x:Null}" /> <VisualState x:Name="Pressed" Storyboard="{x:Null}" /> <VisualState x:Name="Disabled" Storyboard="{x:Null}" /> </VisualStateGroup> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused" Storyboard="{x:Null}" /> <VisualState x:Name="Unfocused" Storyboard="{x:Null}" /> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </Button.Style> </Button></telerik:InlineUIContainer><t:Span FontFamily="Calibri" Text=" % (" /><telerik:InlineUIContainer xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="20" Style="{x:Null}" Width="30" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> <telerik:InlineUIContainer.DefaultStyleSettings> <Telerik_Windows_Documents_Model_Styles_Telerik_Windows_Documents:StyleDefinition BasedOn="{x:Null}" xmlns:Telerik_Windows_Documents_Model_Styles_Telerik_Windows_Documents="clr-namespace:Telerik.Windows.Documents.Model.Styles;assembly=Telerik.Windows.Documents" /> </telerik:InlineUIContainer.DefaultStyleSettings> <Button Content="XX" FontSize="12" Height="30" HorizontalAlignment="Center" Margin="0,0,0,0" Tag="ID|... width = numcaracteres * 8" VerticalAlignment="Bottom" Width="30"> <Button.Background> <SolidColorBrush Color="#00FFFFFF" /> </Button.Background> <Button.Foreground> <SolidColorBrush Color="#FFFF0000" /> </Button.Foreground> <Button.Style> <Style BasedOn="{x:Null}" TargetType="Button"> <Setter Property="Foreground"> <Setter.Value> <SolidColorBrush Color="#FF000000" /> </Setter.Value> </Setter> <Setter Property="Padding"> <Setter.Value> <Thickness>0,0,0,0</Thickness> </Setter.Value> </Setter> <Setter Property="BorderThickness"> <Setter.Value> <Thickness>0,0,0,0</Thickness> </Setter.Value> </Setter> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid Margin="0,0,0,0"> <Border x:Name="Background" Background="{x:Null}" BorderThickness="0,0,0,1" CornerRadius="0,0,0,0"> <Border.BorderBrush> <SolidColorBrush Color="#FFFF0000" /> </Border.BorderBrush> <Grid Background="{x:Null}" Margin="0,0,0,0"> <Border x:Name="BackgroundAnimation" Child="{x:Null}" Opacity="0"> <Border.Background> <SolidColorBrush Color="#FF448DCA" /> </Border.Background> </Border> </Grid> </Border> <ContentPresenter x:Name="contentPresenter" Content="{x:Null}" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Bottom" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" Storyboard="{x:Null}" /> <VisualState x:Name="MouseOver" Storyboard="{x:Null}" /> <VisualState x:Name="Pressed" Storyboard="{x:Null}" /> <VisualState x:Name="Disabled" Storyboard="{x:Null}" /> </VisualStateGroup> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused" Storyboard="{x:Null}" /> <VisualState x:Name="Unfocused" Storyboard="{x:Null}" /> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </Button.Style> </Button></telerik:InlineUIContainer><t:Span FontFamily="Calibri" Text=") text text text." /></t:Paragraph> <t:Paragraph SpacingAfter="6.66666650772095" SpacingBefore="6.66666650772095" /> </t:Section></t:RadDocument>and when i try to get the document from it again I get the following exception:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E)
Timestamp: Thu, 18 Nov 2010 10:08:51 UTC
Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.TypeInitializationException: The type initializer for 'Telerik.Windows.Documents.Layout.RadTextMeasurer' threw an exception. ---> System.UnauthorizedAccessException: Invalid cross-thread access.
at MS.Internal.XcpImports.CheckThread()
at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex, IntPtr constructDO)
at System.Windows.Controls.TextBlock..ctor()
at Telerik.Windows.Documents.Layout.RadTextMeasurer.InitializeMeasureBlock()
at Telerik.Windows.Documents.Layout.RadTextMeasurer..cctor()
--- End of inner exception stack trace ---
at Telerik.Windows.Documents.Layout.RadTextMeasurer.Measure(String text, Span span)
at Telerik.Windows.Documents.Layout.SpanLayoutBox.MeasureTextOverride()
at Telerik.Windows.Documents.Layout.SpanLayoutBox.MeasureText()
at Telerik.Windows.Documents.Layout.SpanLayoutBox.MeasureOverride(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
at Telerik.Windows.Documents.Layout.ParagraphLayoutBox.MeasureOverride(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
at Telerik.Windows.Documents.Layout.SectionLayoutBox.MeasureOverride(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
at Telerik.Windows.Documents.Layout.LayoutElement.Arrange(RectangleF finalRect)
at Telerik.Windows.Documents.Layout.DocumentLayoutBox.ArrangeTask.ArrangeCallback(Object state)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Line: 56
Char: 13
Code: 0
URI: http://localhost:55603/SilverlightApplication6TestPage.aspx
Is InlineUIContainer supported for serialization or not? Is there a way to have only a few paragraphs or spans editable where others are not?
Thanks