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
15
set one tile default be maximized
posted

Hi there,

    I am using the tile manager for our project and like to set one tile to be maximized and other tiles be minimized.

    I read all samples which are using code behind or specifically set state in xaml file, but I am using MVVM model. somehow I could not achieve it. 

    the following is code I am using, let me know if there is anything wrong:

     

<ig:XamTileManager Grid.Row="1" x:Name="TileManager" HeaderPath="DeviceType" Background="#FF003A62" BorderThickness="0" Margin="0,30,0,0" MaximizedTileLimit="1" ItemsSource="{Binding Items}">
<ig:XamTileManager.Resources>
<Style TargetType="{x:Type ig:XamTile}">
<Setter Property="ExpandButtonVisibility" Value="Hidden"/>
<Setter Property="IsMaximized" Value="true"/>
<EventSetter Event="MouseLeftButtonDown" Handler="Tile_MouseLeftButtonDown"/>
</Style>

<Style TargetType="{x:Type igPrim:TileHeaderPresenter}">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#FF7596B5"/>
<Setter Property="Padding" Value="4,0,2,0"/>
<Setter Property="MinHeight" Value="20"/>
<Setter Property="FontFamily" Value="Calibri"/>
<Setter Property="FontSize" Value="15"/>
</Style>
</ig:XamTileManager.Resources>
<ig:XamTileManager.NormalModeSettings>
<ig:NormalModeSettings TileLayoutOrder="HorizontalVariable"
MaxRows="4"
ShowAllTiles="True"
VerticalTileAreaAlignment="Top"
HorizontalTileAreaAlignment="Left">
<ig:NormalModeSettings.TileConstraints>
<ig:TileConstraints MinWidth="320" MinHeight="300" />
</ig:NormalModeSettings.TileConstraints>
</ig:NormalModeSettings>
</ig:XamTileManager.NormalModeSettings>

<ig:XamTileManager.MaximizedModeSettings>
<ig:MaximizedModeSettings AllowTileDragging="Swap"
MaximizedTileLocation="Left"
MinimizedTileExpansionMode="AllowMultiple"
VerticalTileAreaAlignment="Stretch"
HorizontalTileAreaAlignment="Stretch">
<ig:MaximizedModeSettings.MinimizedTileConstraints>
<ig:TileConstraints PreferredHeight="100" PreferredWidth="250"/>
</ig:MaximizedModeSettings.MinimizedTileConstraints>
<ig:MaximizedModeSettings.MaximizedTileConstraints>
<ig:TileConstraints MinWidth="900" MinHeight="500"/>
</ig:MaximizedModeSettings.MaximizedTileConstraints>
</ig:MaximizedModeSettings>
</ig:XamTileManager.MaximizedModeSettings>

<ig:XamTileManager.ItemTemplateMaximized>
<DataTemplate>
<ContentControl
Content="{Binding CurrentViewModel}"
ContentTemplateSelector="{StaticResource TileTemplateSelector}"/>
</DataTemplate>
</ig:XamTileManager.ItemTemplateMaximized>

<ig:XamTileManager.ItemTemplate>
<DataTemplate>
<Grid Height="180">
<Label HorizontalAlignment="Center" Margin="0,20,0,0" Content="{Binding DeviceType}" Foreground="#FF003A62" FontFamily="Calibri" FontSize="20" />
<Label HorizontalAlignment="Center" Margin="0,60,0,0" Content="{Binding CurrentViewModel.StatusMessage}" Foreground="#FF003A62" FontFamily="Calibri" FontSize="20"/>
</Grid>
</DataTemplate>
</ig:XamTileManager.ItemTemplate>
<ig:XamTileManager.ItemTemplateMinimized>
<DataTemplate>
<Grid Height="180">
<Label HorizontalAlignment="Center" Margin="0,20,0,0" Content="{Binding DeviceType}" Foreground="#FF003A62" FontFamily="Calibri" FontSize="20" />
<Label HorizontalAlignment="Center" Margin="0,60,0,0" Content="{Binding CurrentViewModel.StatusMessage}" Foreground="#FF003A62" FontFamily="Calibri" FontSize="20"/>
</Grid>
</DataTemplate>
</ig:XamTileManager.ItemTemplateMinimized>

</ig:XamTileManager>

I tried to set all tile to be maximized and expecting that the last one will be maximized and others will be pushed to side. 

and also I tried to using the binding to property of IsMaximized and set one tile to be true, others are false.

but both of way do not work for me.

any idea about how to fix it?

thanks,

William