Hi,
I have an SL app that displays dashboards using the XamTileView in combination with the XamDataChart and XamGrid. Since upgrading to Silverlight 5 the following issue now occurs:
System.AccessViolationException was unhandled Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt. InnerException:
Click here for the call stack from VS - https://skydrive.live.com/?cid=09f71a6daa654209#cid=09F71A6DAA654209&id=9F71A6DAA654209%21259
The ImageColumn is set up as follows:
column = new ImageColumn { Key = string.Format("Column{0}", j), HeaderText = label, Width = new ColumnWidth(columnWidth, false), ImageWidth = 16, ImageHeight = 16, ImageStyle = Application.Current.Resources["KpiStatusIconStyle"] as Style, ValueConverter = Application.Current.Resources["StatusIconConverter"] as IValueConverter, MinimumWidth = 30 };
I am running the latest version of the SL client - 5.1.10411.0
Can you please advice of potential solutions.
Regards,
Chris
Hello Chris,
Thank you for your post. I have been looking into it but it seems like that I am missing something in your scenario, so could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.
Hi Stefan,
This issue is emerging from an Enterprise application and I do not currently have the time/resources to try and recreate the issue on a small scale.
To give you some more information, we are using PRISM and MVVM to build the application. Once a piece of analysis has been visualised on a dashboard i.e. data retrieved and rendered as a chart/grid etc., the visualisation itself is stored in a ViewModel and not recreated when re-accessed by navigating away and then back. When the control is re-bound to display itself again the following code is run to ensure the visual tree can add the control again:
public static void ClearParent(object obj) { if (obj == null) return;
var control = obj as FrameworkElement;
if (control == null) return;
var contentPresenter = control.Parent as ContentPresenter; if (contentPresenter != null) { contentPresenter.Content = null; }
var contentControl = control.Parent as ContentControl; if (contentControl != null) { contentControl.Content = null; } }
Below is a link containing all the relevant XAML from the dependent components. This includes:
http://sdrv.ms/S0bLne
In the example visualisation control the first column in the grid is an ImageColumn. With the column included the browser crashes as explained in the original post. If the column is removed or the workaround I have come up with applied, all works as expected.
If you need any further information please let me know.
I have been looking into your post and the provided XAML, but without a sample, where the issue is reproduced I am not able to investigae this further for you, since it is not a known issue, so whenever you have time to create a small isolated project, we will be happy to assist you further.
Same problem here when using the imagecolumn.
If a value converter is used the error occurs.
Ok code
<ig:ImageColumn Key="RequestStatus" HeaderText=" " Width="24" IsSortable="False"/>
Not ok code:
<ig:ImageColumn Key="RequestStatus"
ValueConverter="{StaticResource RequestStatus}" HeaderText=" " Width="24" IsSortable="False"/>
Ingo
It does not happen when I create a new instance of the control instead of reusing an existing one.
regards,
Hello Ingo,
I have logged this with development under ID: 126052 and I have also created a support ticket on your behalf: CAS-103735-R7L1M8 and have linked the development issue to it, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags: https://es.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://es.infragistics.com/Membership/MySupport.aspx
Also until this is fixed you can use the workaround I implemented in your sample.
Please check my two/three latest posts on that matter. I have attached a solution.
Thank you for your post. I have been looking into it and I created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.