This is a migrated thread and some comments may be shown as answers.

Accessing TileViewPanel

2 Answers 58 Views
TileView
This is a migrated thread and some comments may be shown as answers.
mitica
Top achievements
Rank 1
mitica asked on 08 Jun 2011, 02:58 PM
Hi,

is it possible to access the TileViewPanel.
Basically, I need to know the actual available space for the maximized item in order to do some scaling for the UserControl hosted inside the TileViewItem. I assume that this information is available somewhere in this panel.

Thank you!


2 Answers, 1 is accepted

Sort by
0
mitica
Top achievements
Rank 1
answered on 09 Jun 2011, 10:47 AM
Hi,

to be more specific, I would like to have the MaximizedItem Container only as big as its content and not as big as the available space for it (by available space I mean ViewPort.Width - minimizedColumnWidth).

I tried changing the template for the TileViewItem as below:
<Style x:Key="RadTileViewItemStyle1" TargetType="telerikNavigation:RadTileViewItem">
            ......
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerikNavigation:RadTileViewItem">
 
                        <Canvas> <!-- this used to be grid-- >
                         ......
                       </Canvas>
 
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
Basically, I have replaced the outer grid with a canvas.
Now, the MaximizedItem shows the way I wanted but there are some issues with the Restored and Minimized Items:
- the restored item contains a ListBox defined as below

<telerik:RadTileView.ContentTemplate>
                <DataTemplate>
<
telerik:RadFluidContentControl ContentChangeMode="Manual"
..........................
 <telerik:RadFluidContentControl.Content>
                            <Grid>
                                <ContentControl Content="{Binding Path=ParametersList}" HorizontalAlignment="Left" Width="Auto" Height="Auto" />
                            </Grid>
                        </telerik:RadFluidContentControl.Content>
 
............................
</telerik:RadFluidContentControl>
</DataTemplate>
</telerik:RadTileView.ContentTemplate>
The problem is that when in RestoredState, the items expand way out vertically untill all the ListBoxItems are visible (no vertical scroll bar).

Can you suggest a solution for implementing the described layout?

Thank you
0
Accepted
Zarko
Telerik team
answered on 09 Jun 2011, 02:54 PM
Hi mitica,
You can access the TileViewPanel through the RadTileView using the ChildrenOfType method like this:
var panel = this.myTileView.ChildrenOfType<TileViewPanel>().FirstOrDefault();
The problem is that you don't know the MaximizedItems content size before it is measured and you'll have to wait to adjust the MinimizedColumnWidth/Height. Also you can replace the Grid with Canvas only to the MaximizedItem with something like this:
case TileViewItemState.Maximized:
            container.Style = this.Resources["RadTileViewItemStyle"] as Style;
case TileViewItemState.Minimized:
            container.ClearValue(RadTileViewItem.StyleProperty);
case TileViewItemState.Restored:
            container.ClearValue(RadTileViewItem.StyleProperty);
For further references could you please examine the attached project? The only problem in it that because of the animation and dispatcher combination there could be some glitches.
If you have more questions feel free to ask.

Best wishes,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TileView
Asked by
mitica
Top achievements
Rank 1
Answers by
mitica
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or