Hello,
I want to create a xamTileManager with Tile items in a different xaml file.
My VM add some properties that I use in the manager :
<ig:XamTileManager Name="xamTilesControl1" Margin="10,0,0,0" MaximizedTileLimit="3" DataContext="{Binding ResultGrid}"> <ig:XamTileManager.NormalModeSettings> <ig:NormalModeSettings TileLayoutOrder="HorizontalVariable" HorizontalTileAreaAlignment="Stretch" VerticalTileAreaAlignment="Stretch" AllowTileDragging="Slide" AllowTileSizing="Individual"> <ig:NormalModeSettings.TileConstraints> <ig:TileConstraints MinWidth="200" MinHeight="200" /> </ig:NormalModeSettings.TileConstraints> </ig:NormalModeSettings> </ig:XamTileManager.NormalModeSettings> <ig:XamTileManager.MaximizedModeSettings> <ig:MaximizedModeSettings AllowTileDragging="No" ShowTileAreaSplitter="False" ShowAllMinimizedTiles="True" MinimizedTileExpansionMode="AllowOne" VerticalTileAreaAlignment="Top" MaximizedTileLayoutOrder="HorizontalWithLastTileFill"> <ig:MaximizedModeSettings.MaximizedTileConstraints> <ig:TileConstraints MaxHeight="300" MaxWidth="450" /> </ig:MaximizedModeSettings.MaximizedTileConstraints> <ig:MaximizedModeSettings.MinimizedTileConstraints> <ig:TileConstraints MinWidth="150" MinHeight="50" /> </ig:MaximizedModeSettings.MinimizedTileConstraints> <ig:MaximizedModeSettings.MinimizedExpandedTileConstraints> <ig:TileConstraints MinWidth="150" MinHeight="100" /> </ig:MaximizedModeSettings.MinimizedExpandedTileConstraints> </ig:MaximizedModeSettings> </ig:XamTileManager.MaximizedModeSettings> <v:ResultGridItemView DataContext="{Binding UpperLeft}" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" /> <v:ResultGridItemView DataContext="{Binding UpperRight}" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" /> <v:ResultGridItemView DataContext="{Binding LowerLeft}" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" /> <v:ResultGridItemView DataContext="{Binding LowerRight}" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" /> <!--<ig:XamTile Header="IntensityPlot" Content="{Binding ResultGrid.UpperRight}" Visibility="{Binding ResultGrid.UpperRight.IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" IsMaximized="True"> <ig:XamTile.ContentTemplate> <DataTemplate> <v:ResultGridItemView/> </DataTemplate> </ig:XamTile.ContentTemplate> </ig:XamTile>--> </ig:XamTileManager>
Here is the style of each item :
<ig:XamTile Header="Title" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" Content="{Binding Content}" IsMaximized="True"> <ig:XamTile.ContentTemplate> <DataTemplate> <ContentPresenter ContentTemplateSelector="{StaticResource ResultNodeSelector}" Margin = "4,0,4,4"/> </DataTemplate> </ig:XamTile.ContentTemplate> </ig:XamTile>
I attached the style of my manager and the picture of the result.
Could you help me and prevent this inception ?
Regards
I think that remove style to the principal scrollviewer will help hard coded elements to be correctly display.
I maybe have an idea.
The XamlTileManager.ItemTemplate isn't the right level to apply a custom dataTemplate from an other xaml file with XamTile in it.
Maybe the XamTilePanel need to changed to accept the re-definition of a full XamTile style from an other xaml.
Could you confirm my ideas and help me ?
Hi teamtim,
Does this mean you were able to get it working the way you wanted now? If so I recommend marking your post as the answer.
The aim of creating a different file for itemResultView is too prevent copy/paste of each path and settings.
I think I find why there is this inception. By default, your control apply XamTileStyle when an item is added like this :
<Grid Grid.Column="2"> <ig:XamTileManager Name="xamTilesControl1" Margin="10,0,0,0" MaximizedTileLimit="3" DataContext="{Binding ResultGrid}">
<ig:XamTileManager.NormalModeSettings> </ig:XamTileManager.NormalModeSettings>
<ig:XamTileManager.MaximizedModeSettings> </ig:XamTileManager.MaximizedModeSettings>
<v:ResultGridItemView DataContext="{Binding UpperLeft}" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" /> <v:ResultGridItemView DataContext="{Binding UpperRight}" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" /> <v:ResultGridItemView DataContext="{Binding LowerLeft}" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" /> <v:ResultGridItemView DataContext="{Binding LowerRight}" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibility}, ConverterParameter=Collapsed}" /></ig:XamTileManager>
I want to prevent this, by removing the style when I added items manually and let me configure the style for all elements.
And inceptions will not be here.
The other solution, is to access to parent datacontext or\and parent tile and edit content with the right designViewModel.
Not sure why your header is showing up inside the tile like that. Inside the actual XamTile is controlled by your ResultGridItemView control. If you want headers to show on the XamTile using your code then you need to set the HeaderPath property on the XamTileManager. This HeaderPath points to a property inside your ResultGridItemView since that is what the DataContext of the XamTiles is going to be. Please see the sample I have attached for what I mean.
Other than this, I don't understand what your exact issue is. Could you include an image that shows where you want the title and where you want the content for the XamTiles?
I want one XamTile by element and not a XamTile inside.
I mean that each element will be with the same style, here, the title is only visible inside the tile.
A set the context of the resultItem, so the tile will get this and set the title and datas to the right place.
The tile have the expand button, that I force in the style but not inside.
So what is the solution to put the title and the content to the right area ?