I use the TilePanel to basically create a multi document interface for the top level records that are displayed in my app. My problem is that if users click the close button, the tile closes, but stays in memory along with the control it contains and therefore is not disposed and no new instance can be created. I tried using a sample I found somehwere on this site, but it did not work.
Any help would be appreciated
You could try to dispose or remove the tile in its VisibleChanged event if the tile is invisible (closed).
I hope this will help you.
I tried that. but apparently while the tiles are changing their state, they all change their visibility so I ended up with no windows left.
Can you give me a sample showing what you are doing so I can suggest you something more helpful
I am interested too to this issue, because I need to catch, in some way, the moment right before a tile is closed (with x button) and then if necessary avoid the closing; then if the tile could close (based on my own logic) catch the moment right after tile has been closed.
Is there a clean way to do that?Have you some advices to give me?
Thanks in advance
Not sure what you're asking. I am loading my windows (usercontols) into individual tiles. When a user clicks the close button I would like to destroy the user control and remove the tile from the TilePanel.Tiles Collection or give them an option to abort the closing if they made a mistake. This allows me to reload a window if need be from scratch and allows me to run code in the dispose method that I need to run.