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

Bug?: Threshold values stick and don't change when tiles resize

2 Answers 58 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 24 Aug 2010, 05:49 PM
The best way to see this defect is to run the demo application for BMW Cars (the "Events" demo)

Click on one of the tiles to maximize its size. It is displaying in "normal" view with just the image of the car initially. When you maximise the tile the "large" view is displayed which shows additional text data for the vehicle and adjusts the position of the image.

Now minimise the tile to return it to its original size. The "detail" ("Large") view is still being displayed. The tile has not returned to "normal" display as it should do.

The demo site isn't the best example because all the views contain an image of the car, but if you set up the tiles with radically different views (eg I used just a textbox with "Large", "Normal" and "Small") you can see that the switch from "normal" to "large" works as expected from thereonin no matter what the size of the tile is it is stuck in "large" view, which typically means the contents are all truncated and the tile is effectively unusable.

2 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 25 Aug 2010, 05:36 PM
Hi Ian,

I replied to your support ticket, pasting some of my reply here:

-----------

Thank you for sending the sample project!

It seems that the thresholds in the example are not well chosen. Since both values (width, height) of a threshold need to be exceed for the state change to happen the LargreToNormalThreshold with a Height of 160 is not reached when the tiles are restored. 

If a different threshold is chosen, the state change will occur.

I have logged this as a bug in the examples.

Managing the thresholds with a TileView that can size may not be trivial - there is the option to bind the FluidContentControl's state to the TileViewItem's state. A converter is needed for this:

public class TileToFluidStateConverter : IValueConverter
{
    public object Convert(object value, Type targetType, 
        object parameter, System.Globalization.CultureInfo culture)
    {
        var tileState = (TileViewItemState)value;
        switch (tileState)
        {
            case TileViewItemState.Maximized:
                return FluidContentControlState.Large;
            case TileViewItemState.Minimized:
                return FluidContentControlState.Small;
            case TileViewItemState.Restored:
            default:
                return FluidContentControlState.Normal;
        }
    }
  
    public object ConvertBack(object value, Type targetType, 
        object parameter, System.Globalization.CultureInfo culture)
    {
        // Not needed;
        throw new NotImplementedException();
    }
}

Then used like so:

<telerik:RadTileViewItem x:Name="customerSearch">
    <telerik:RadTileViewItem.Header>
        <TextBlock Text="Customer Search Criteria"  />
    </telerik:RadTileViewItem.Header>
    <telerik:RadTileViewItem.Content>
            <telerik:RadFluidContentControl ContentChangeMode="Manual" 
           State="{Binding TileState, ElementName=customerSearch, Converter={StaticResource TileToFluidState}}" >
            <telerik:RadFluidContentControl.SmallContent>
                <Border Width="193" Height="130">
                    <TextBlock Text="Small" />
                </Border>
            </telerik:RadFluidContentControl.SmallContent>


Hopefully you will be able to use this,

Your Telerik Points have been updated for your feedback.

Regards,
Miroslav
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
0
Ian
Top achievements
Rank 1
answered on 25 Aug 2010, 06:13 PM
Thanks Miroslav for the very prompt reply.  In fact as part of ongoing development I changed the Width and Threshold values used and managed to get a combination that works fine.  The control is working very nicely with minimal effort now, thanks! :-)
Tags
TileView
Asked by
Ian
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Ian
Top achievements
Rank 1
Share this question
or