Silverlight 4 ManagedRuntimeError 4004 Listbox Scrolling Image XamlParseException -
Silverlight 4 is crashing on me Just-In-Time Debugger says:
Exception code without a verb ('without error error in Silverlight application'): 4004 Category: ManagedRuntimeError Message: System.Windows.Markup.XamlparseException: [Row: 0 Position: 0]
I am tearing a list in the collection of 20 (or so) items. The collection loads properly and binds correctly. However, when I scroll down to the bottom of the collection and then try to scroll back silver light accidents.
The error occurs when I include an image control within a contentcontrol, contentpresenter, or my item template. For example, if I set the 'inner-border' height to 100 and remove the content control, the light will not crash. Apart from this, {visual binding} is defined on the visual model of an image item
Here is my code
. & Lt ;. Border horizontalAlignment = "left" margin = "2" padding = "0" & gt; & Lt; Control: Spread expansion = "correct" header = "template" & gt; & Lt; ListBox UseLayoutRounding = "false" SelectedItem = "{Binding SelectedTemplate, Mode = TwoWay}" Margin = "4" ItemsSource = "{Binding templates}" ScrollViewer.VerticalScrollBarVisibility = "Visible" width = "250" & gt; & Lt; ListBox.ItemTemplate & gt; & Lt; DataTemplate & gt; & Lt; Border style = "{StaticResource InnerBorder}" width = "200" margin = "4" & gt; & Lt; ToolTipService.ToolTip & gt; & Lt; Tooltip content = "{binding description}" /> & Lt; /ToolTipService.ToolTip> & Lt; StackPanel Orientation = "Vertical" VerticalAlignment = "Center" HorizontalAlignment = "Center" & gt; & Lt; Content control content = "{visual binding}" MaxWidth = "100" /> & Lt; Text block text = "{binding name}" horizontal align = "center" /> & Lt; / StackPanel & gt; & Lt; / Border & gt; & Lt; / DataTemplate & gt; & Lt; /ListBox.ItemTemplate> & Lt; / ListBox & gt; & Lt; / Control: Expander & gt;
Any help I completely lost will be greatly appreciated.
I was having this same issue. I managed to track it down from ToolTipService
if I show a tooltip, scrolls, crashes (only on some items). If I remove tooltip binding, then this problem gets resolved.
I have not solved that problem so that tooltips can be displayed, but at least I can get crashes.
Update
I have succeeded in solving the problem and have hired tooltips. Like you, I was directly setting tooltip content directly on some text. Instead, I actually set the content for a containing StackPanel
a TextBlock
that then contained text and now works without crashing it. I am not completely sure why this works unfortunately.
Comments
Post a Comment