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

Reset Layout

5 Answers 64 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 14 Sep 2010, 05:08 PM
Hi,

I am looking for the best way to reset the layout of a view that contains a RadTileView control, sitting along side a RadExpander. navigating away from the screen and then back should present the screen in its original form. Setting the tiles states back to their original values i.e. maximised or minimised does not affect their width and as the tiles contain RadFluidContentControls the user is presented with incorrect content initially. I have tried setting the width of the tile view items manually but this does not work as expected and can push one of the tiles out of view.

Regards,
Chris

5 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 16 Sep 2010, 03:34 PM
Hello Chris,

I've prepared a small project that demonstrates how to bind the State of the FluidContentControl to the TileState of the TileViewItem. In this way, you will be 100% sure that the correct content is shown and not worry about thresholds. Have a look at it and let me know how it works for you.

Regards,
Kiril Stanoev
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
Chris
Top achievements
Rank 1
answered on 17 Sep 2010, 02:22 PM
Hi Kiril,

In terms of resetting the layout this solution works perfectly, so thank you for taking the time to knock up the demo.

The one thing the solution doesn't handle is getting the order of the tiles back to how they were originally.

Would this be a simple task to achieve?

Regards,
Chris
0
Miro Miroslavov
Telerik team
answered on 23 Sep 2010, 10:17 AM
Hi Chris,

 I've tried it with binding the Position property of the Containers to the ViewModels' but unfortunately the TileViewItems doesn't respect it. The only solution I came up is resetting the ItemsSource like follows. (Just replace the MainPage.cs)

public partial class MainPage : UserControl
{
    IList<MyViewModel> items;
 
    public MainPage()
    {
        InitializeComponent();
 
        this.radTileView.ItemsSource = items = MyViewModel.GenerateItems();
    }
 
    private void ResetLayout_Click(object sender, RoutedEventArgs e)
    {
        foreach (var item in this.items)
        {
            item.ContentState = ContentState.NormalContent;            
        }           
 
        this.radTileView.ItemsSource = null;
        this.radTileView.ItemsSource = this.items;
    }
}

Hope will help you.

Greetings,
Miro Miroslavov
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
Chris
Top achievements
Rank 1
answered on 23 Sep 2010, 10:32 AM
Hi Miro,

We have found our own solution for this issue, by using the ViewModel to determine the position of the tiles, as opposed to the tiles knowing themselves. When we load the content dynamically the content creates its own RadTileViewItem and injects its content. The content the added to the page is ordered based on the Position element of each of the tiles at the point of saving the ayout previsouly.

Te position of the content object is maintained by updating the ViewModel whenever the PositionChanged event of the tiles if fired. Seems to work nicely!

Regards,
Chris
0
Miro Miroslavov
Telerik team
answered on 23 Sep 2010, 12:11 PM
Hello Chris,

 Happy to hear that. I've also created work item to check our own logic inside the control and more precisely - the way we deal with changing the Position property of the TileViewItem.
If you need more help, please let us know.

Greetings,
Miro Miroslavov
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
Chris
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Chris
Top achievements
Rank 1
Miro Miroslavov
Telerik team
Share this question
or