I have a style defined for XamTile as follows:
<Style TargetType="ig:XamTile" x:Key="fistyle"> <Setter Property="IsMaximized" Value="{Binding Selected,Mode=TwoWay}"/> </Style>Within the XamTileManager this style is being set as the ItemContainerStyle. The theory is that as I add new items to the TileManager I can set Selected=true on the items viewmodel to make the new tile Maximzed.
Unfortunately, it doesn't work. There are no binding errors and I have confirmed the Style is applied. (I set IsHitTestVisible=False in the style to test it).
Hello,
I am attaching a sample of one way of implementing it.
When you load the sample you will see the second tile maximized. This is initially set up in XAML. Then use the "Add Tile" button to add new tiles. The new tiles are set up using the style like the one you provided, which sets the new tile in maximized state.
Let me know how this works for you, or any questions you may have.
Sam
Hi Sam,
I have looked at the sample. It is working fine. Now my question is:
Just to clarify the context, In my case, I use a command to handle the button click. The command is in the view model. So I do not want to access view's content (tile) at view model. I have a IsMaximized property in the view model. All we need to bind the IsMaximided property of the tile to the view model 's property. It is best for me if I can do the binding in XAML.
Thanks,
Amatul