hello i'm using xamtile in xamtilemanager 9X9
I want xamtile to automatically resize
<picture 1> xaml
<ig:NormalModeSettings HorizontalTileAreaAlignment="Stretch" VerticalTileAreaAlignment="Stretch" TileLayoutOrder="Horizontal" AllowTileDragging="Swap" AllowTileSizing="No"> <ig:NormalModeSettings.TileConstraints> <ig:TileConstraints PreferredHeight="1" PreferredWidth="300"/> </ig:NormalModeSettings.TileConstraints> </ig:NormalModeSettings>
<picture 2>
<ig:NormalModeSettings HorizontalTileAreaAlignment="Stretch" VerticalTileAreaAlignment="Stretch" TileLayoutOrder="Horizontal" AllowTileDragging="Swap" AllowTileSizing="No"><ig:NormalModeSettings.TileConstraints><ig:TileConstraints PreferredHeight="1" PreferredWidth="400"/></ig:NormalModeSettings.TileConstraints></ig:NormalModeSettings>
I want to use <ig:TileConstraints PreferredHeight="auto" PreferredWidth="auto"/> but auto is can't.
In addition, binding to PreferredHeight and Preferredwidth is not possible.
Is there any way to automatically align the xamtile without specifying the size?
It has been a good guide for me. thank you!
Hello Kim,
Unfortunately, the properties of NormalModeSettings are not bindable because the NormalModeSettings object is not a visual or FrameworkElement and as such does not expose a DataContext so it cannot be directly bound. If you bring in a resource to bind to, you can bind it though. For example, if you brought in a resource with an x:Key of “resource” that had a MaxRows property to control this, you could use the following:
<ig:NormalModeSettings MaxRows="{Binding Source={StaticResource resource}, Path=MaxRows}" />
It may be worth noting though, that the NormalModeSettings property can be bound since that is on the XamTileManager, which is a visual / FrameworkElement. So, if you stored a property containing a NormalModeSettings object, you could bind that instead.
Please let me know if you have any other questions or concerns on this matter.
<ig:XamTileManager.NormalModeSettings> <ig:NormalModeSettings MaxColumns="2" MaxRows="2" HorizontalTileAreaAlignment="Stretch" VerticalTileAreaAlignment="Stretch" TileLayoutOrder="Horizontal" AllowTileDragging="Swap" AllowTileSizing="No"> <ig:NormalModeSettings.TileConstraints> <ig:TileConstraints PreferredHeight="1" PreferredWidth="1"/> </ig:NormalModeSettings.TileConstraints> </ig:NormalModeSettings> </ig:XamTileManager.NormalModeSettings>
MaxColumns 2, MaxRows 2 = 4tiles
MaxColumns 3, MaxRows 3 = 9tiles
MaxColumns 4, MaxRows 4 = 16tiles
I think I've found a way, but it's not perfect. In my opinion, if can control MaxColumns and MaxRows with a Binding, it will work perfectly. Can I bind this?
sorry 9x9 is 3x3. The reason I need autosize is that I also need 4x4 = 16xamtile. However, if you apply <ig:TileConstraints PreferredHeight="1" PreferredWidth="400"/> to 4x4, the alignment is not done.