I have an WPF application using XamTileManager. I want to be able to display an image if no tiles are open. How can I detect if the number of open tiles is < 1, then set the visibility of an object to visible?
Doing this in either xaml or c# is ok
Hello,
You can use the following code in order to count how many Tiles are in normal mode:
int count = 0; foreach (var item in xtm.Items) { if ((item as XamTile).State == TileState.Normal) { count++; } }
Since I am not completely sure what do you mean by "number of tiles open", I can say that you can modify the "if" statement, so it covers your requirements.
Hope this helps you.
I do need further assistance on this matter. Do you have any example code for WPF C# that shows the syntax for finding out if the number of tiles open is less than 1?
Thank you for your post. I have been looking into it and I can suggest you use the XamTileManager’s Items Property, which will return a collection of all the Tiles. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.