Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Problem positioning tiles when some are collapsed

$
0
0

Here is my solution, it's not terrible.  Maintain a flag indicating first time initialization is in progress.  Once the last tile in xaml is positioned then set tiles to desired position and turn off flag

 code

Partial PublicClassMainPage
    InheritsUserControl
 
    'in xaml position is : 1 2 3 4 5
    'desired position is : 2 1 3 4 5
 
    Private_firstTime AsBoolean= True
 
    PublicSubNew()
        InitializeComponent()
    EndSub
 
    PrivateSubLastTile_PositionChanged(sender AsObject, e AsTelerik.Windows.RadRoutedEventArgs)
        If_firstTime Then
            _firstTime = False
            Tile2.Position = 0 'this is not honored
        EndIf
    EndSub
EndClass
 

xaml 

 

<UserControlxmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="TelerikTileViewTest.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="400"d:DesignWidth="800">
 
    <Gridx:Name="LayoutRoot"Background="White">
 
        <telerik:RadTileViewName="TileView"IsItemsAnimationEnabled="False"PreservePositionWhenMaximized="True">
            <telerik:RadTileViewItemName="Tile1"Header="Tile 1">
                <TextBlockText="Tile 1 Content"/>
            </telerik:RadTileViewItem>
            <telerik:RadTileViewItemName="Tile2"Header="Tile 2">
                <TextBlockText="Tile 2 Content"/>
            </telerik:RadTileViewItem>
            <telerik:RadTileViewItemName="Tile3"Header="Tile 3">
                <TextBlockText="Tile 3 Content"/>
            </telerik:RadTileViewItem>
            <telerik:RadTileViewItemName="Tile4"Header="Tile 4">
                <TextBlockText="Tile 4 Content"/>
            </telerik:RadTileViewItem>
            <telerik:RadTileViewItemName="Tile5"Header="Tile 5"PositionChanged="LastTile_PositionChanged">
                <TextBlockText="Tile 5 Content"/>
            </telerik:RadTileViewItem>
        </telerik:RadTileView>
         
    </Grid>
</UserControl>

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>