Access Minimize/Maximize on TileViewControl from child.

I am attempting to add the ability to minimize a tile from a cancel button inside a child control on TileViewControl.MaximizedItemTemplate.
We haven't been able to successfully access a tileviewitem, because our tileviewcontrol is databound to an itemsource, and its selecteditem property is returning a collection of those and not tileviewitems - which have access to tileviewitemstate.
Does anyone have any experience with this issue?
Thanks!
MD

1 Reply

DR Durga Rajan Syncfusion Team January 2, 2018 04:37 PM UTC

Hi Michael Dixon, 

Thank you for contacting Syncfusion support. 

Query : We haven't been able to successfully access a tileviewitem, because our tileviewcontrol is databound to an itemsource, and its selecteditem property is returning a collection of those and not tileviewitems - which have access to tileviewitemstate 

                Whenever TileViewControl is bound with ItemsSource, we can get the instance of TileViewItem from the object using ItemContainerGenerator’s ContainerFromItem static method. We have preapred a sample which tries to get the Container(TileViewItem) from BookModek object(in the sample).  

However, changing the state of TileViewItem by getting the TileViewItem using ItemContainerGenerator is not recommended approach, if you are using MVVM, Prism or other patterns. So we suggest you to add a Property(IsMaximized in sample) in Model level and control the state of TileViewItem using that property, with the use of ItemContainerStyle. We have included the changes for this also in the same sample. 



Please let us know if the above sample doesn’t meet your requirement or in case of any concerns. 

Regards, 
Durga S. 



Loader.
Up arrow icon