I would like to use the network nodes control to be a real time view of a network. As events are fired within the system I'd like to update the UI of the nodes so the user can perform certain interactions.
In our application we have a global setting that modifies the font size for the entire application. I have noticed that when I change that value while using the Infragistics NetworkNode control the UI locks for several seconds while the control re-renders itself.
It appears to be re-calibrating to autofit the nodes to the available container space. In my opinion this is a simple scenario. What happens in the case where I want to much more drastically change the content of the nodes? Additionally this freezing of the UI is compounded the more nodes you add to the network. Without a solution the performance makes the control almost unusable.
I have created and attached a sample application that demonstrates this locking of the UI. Click on the buttons to increase or decrease the font size while the progress bar (set to update forever) is moving and you will notice the freezing.
Question:
Is there a property or something I can set to disable this re-rendering of the entire view?
Kind Regards,
Daniel
EDIT: Theoretically I should be able to use the "NodeDistance" property to appropriately set the distance between the nodes to handle increasing/decreasing sizes of the node content myself.
This approach would work, but requires disabling the zooming in and out feature. It also gets tricky when trying to determine the NodeDistance since it will need to change depending on the number of connections between nodes.
I am poking around with the nodes control template and trying to disconnect the fontSize from using my global textBlock style (where the fontSize can change):
<ContentPresenter TextElement.FontSize="12" />
The information was insightful into how and why the resizing occurs.
Hello Daniel,
I was just wondering did you have a chance to try my suggestion. If you still need any assistance on the matter, please do not hesitate to ask.
By default our control is design to arrange its nodes based on the available space and the sizes of the contained elements. After the initial rendering of the control, it provides the functionality to zoom in and out of nodes by keeping the distance between the nodes. Based on this when you zoom the control its font visually not always appear as big as the content outside the XamNetworkNode. Furthermore when you click the “Increase” button the size of the network node is recalculated based on the font of the contained text, since you don’t explicitly set the node sizes, and their proportions gets different, the control needs to rerender itself in order to ensure that it will be displayed correctly.
If you want to prevent the XamNetworkNode from rerendering you can just fix the size of nodes and to control their visual appearance by the zoom of the control.
If you have any further questions or concerns on this matter, please do not hesitate to contact me.
Any updates on this?
-Daniel
Thank you for the sample. I can see your concerns and I am going to consult with our developers on this matter. I will get back to you as soon as I hear from them.