In our application, we have some views containing XamDataCharts inside XamTiles controlled by a XamTileManager on a page inside a XamTabControl. The XamTiles cannot be custom resized by the user, but they can be maximized or restored to preset sizes if the user clicks the maximize button on the tile.
Sometimes when the user maximizes or restores a tile, the XamDataCharts do not redraw properly and the application can become sluggish after this happens. Switching to a different tab page and back usually gets the charts to redraw properly. I cannot demonstrate this in a sandbox project because our code is too complex, but I have included a screenshot showing an example of how one of these graphs looks before maximizing and how the same graph looks after maximizing and restoring.
What can we do to get the XamDataCharts to redraw properly after the tiles have been resized? Is there any event we can handle that tells us when the tiles have changed size? And, if so, is there any method we can call that will force the XamDataCharts to redraw properly after a resize? We tried to handle the Resize event, but it did not get called in most instances.Thank you.
Hello Vonda,
My team and I have done an initial review of this issue, and being that the charts are not resizing properly and your application is slowing down, it sounds like the XamDataChart is getting into a cyclic layout. From the styling of the chart that you have provided, though, it looks like you may be using an older version as well, as the style certainly does not match the current styling of the chart. This issue does sound like something that we may have fixed, though, and so would it be possible for you to please provide the exact version of Infragistics controls that you are using in this case?
Regarding an event that you might be able to use to tell when a tile changes size, since you mentioned that you are maximizing and restoring the tiles, you should be able to use the TileStateChanged event of the XamTileManager. Otherwise, you may be able to use the SizeChanged event of the XamTile objects themselves. As for actually forcing the chart to redraw itself in this case, I am unsure as of yet, but perhaps setting the Height and Width of your chart to the sizing of your XamTile may work for you in this case?
Please let me know if you have any other questions or concerns on this matter.
Thank you for your help. We are using version 16.2.20162.2045. I will look into working with the TileStateChanged event.
In an attempt to reproduce this behavior that you are seeing, I have taken the code from the Infragistics WPF Samples Browser's XamTileManager => Organization => Explicit Tile Layout sample project and placed a XamDataChart in each tile built against version 16.2.20162.2045. When maximizing and restoring the tiles, I cannot seem to reproduce a behavior in which the XamDataChart does not resize correctly.
I am attaching the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates a problem potentially specific to your testing environment.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
TileManagerChartResizeCase.zip