Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1700
Issue with MVVM and style
posted

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

Styles.zip