Does there happen to be away to set the initial state of the TileView to be maximized? Or do I have to wait until I have loaded an initial tile?
Hello,
Are you trying to maximize a TilePane when the XamWebTileView loads? If so the TilePane object exposes a TileState property which you can set to Maximized when you create a pane.
If this is not the case, please give us more information on your scenario.
I am trying to have the state as always maximized. I have a custom template that hides/removes the toggle button, and I can set the first tile to be maximized, if and only if there is a tile there. But if there is no data available yet, then I cannot set the tile to be maximized (as it doesn't exist)
Hi,
I hope this reply is not too late for you.
If I have understood your problem correctly you will be able to do the following: Add an event handler for the CollectionChanged event of the TileView's Items collection and check if the OldItems parameter of the arguments is null and the NewItems.Count is greater than 0. This is the situation when new tiles are added for the first time and I think this is the right moment to maximize the first tile. Here is some code:
=================
this.tileView.Items.CollectionChanged += new NotifyCollectionChangedEventHandler(Items_CollectionChanged); //this line goes in the constructor
void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if ((e.OldItems == null) && (e.NewItems.Count > 0)) (sender as TilePaneCollection)[0].TileState = TileState.Maximized; }
Please find attached a simple demo that adds and removes tiles in real time and keeps the TileView maximized at all times. You will need to add references to the TileView and Silverlight assemblies in the project.
Atanas Dyulgerov
Application Developer with Silverlight
Infragistics
I am happy to hear that I helped. If you have any further questions, please do not hesitate to write.
Thanks Atanas, this looks exactly like what I am looking for.