Hello,
I'm trying out the XamTilesControl, it's very nice but I can't get one thing to work:
When a tile is closed i want to add the tile to another xamTilesControl.
I tried to do that in the TileClosed and in the TileClosing event but it did not work (set the TileCloseAction="RemoveItem" on the source XamTilesControl)
if (sender is XamTilesControl) { if (e.Tile != null) { xamTileControlDashboard.Items.Add(e.Tile); } }
This did not have any effect at all.
What I now do is creating a new tile and copying the properties of the old tile to the new tile and add that new tile to the target XamTilesControl.
Is this the correct way to achieve the behaviour I want or is there another way to do this?
I attached the working project.
When I remove an item i save the content into a list and when the item is added the content is set again.
Works nicely I think.
Thanks for the answer. It's working now.
The closing tiles error was due to an error in my code, sorry for the inconvenience.
Also I can't reproduce the problem that you observed with the closing tiles giving an error. I put buttons as content in all of them and they are closing correctly.
So the tile is added in the xamTileControlSave Items collection but its isClosed property is true. That's why you don't see it.
You can add this line (the first one):
e.Tile.IsClosed = false;xamTileControlSave.Items.Add(e.Tile);
in your code and moving the tile should work.
Hope this helps.
Horen
A little errr in the examle:
The TileClosed event should be:
private void xamTilesControlBase_TileClosed(object sender, Infragistics.Windows.Tiles.Events.TileClosedEventArgs e) { if (sender is XamTilesControl) { if (e.Tile != null) { xamTileControlSave.Items.Add(e.Tile); } } }