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

Setting .TileState from another page

4 Answers 59 Views
TileView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hakki
Top achievements
Rank 1
Hakki asked on 27 Sep 2012, 04:27 PM
Hello,

I have a navbar on the MainFrame.xaml. I have a TileView on the WelcomeScreen.xaml.

The navbar has a Setup button that when clicked I want to maximise a tile in the tileview of WelcomeScreen.

I have tried this method which invoked the Messagebox successfully but did not change the tile size:

MainFrame.xaml.cs
private void SetupButton_Click(object sender, RoutedEventArgs e)
       {
           var wc = new WelcomeScreen();
           wc.MaximiseSetup();
       }

WelcomeScreen.xaml.cs
public void MaximiseSetup()
        {
            //successfully triggers
            MessageBox.Show("Test");
 
            //this doesn't
            SetupTile.TileState = TileViewItemState.Maximized;
        }


Thanks for any help,
Hakki

4 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 01 Oct 2012, 03:39 PM
Hello Hakki Sahinkaya,

I`m not sure I understand your scenario correctly. Are you using a ChildWindow, a UserControl or a Page to represent the WelcomeScreen? Also, can you please elaborate more on where you've placed the WelcomeScreen and when the SetupTile is initialized?

I tried to reproduce the issue in the attached project. Can you please change it in order to demonstrate better your scenario? This way we will be able to investigate what causes the issue?

All the best,
TeamX2_Pavel
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Hakki
Top achievements
Rank 1
answered on 02 Oct 2012, 09:03 AM
Hello,

Thanks for the reply. Here is a project I bashed out real quick duplicating exactly what I'm trying to do. When user clicks the Setup button, that Setup tile should maximise.

https://www.dropbox.com/s/ewtw3584qt8ss05/Telerik%20-%20TileViewMaximiseProblem.zip

As you can see the method to maximise calls the test messabox, but won't maximise tile. I am guessing there is a bad mix of controls/ page etc I am using there.

Anywho, thanks for taking a look and of any ideas to resolve the issue.
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 03 Oct 2012, 03:33 PM
Hello Hakki,

I will go straight to your issue. This code works as expected:

var wc = new WelcomeScreen();
wc.MaximiseSetup();

However, please note that this way a new WelcomeScreen is created and a tile in it is maximized. The point is that the newly created WelcomeScreen is not shown in the MainPage.

Instead, I think you want to maximize the tile on the WelcomeScreen instance that already exists on your MainPage. In order to do this you have to access it. This can be done by replacing your code with the following:

if (ContentFrame.Content is WelcomeScreen)
{
    (ContentFrame.Content as WelcomeScreen).MaximiseSetup();
}

For your convenience I implemented the above the changes in the attached project.

Greetings,
TeamX2_Pavel
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Hakki
Top achievements
Rank 1
answered on 05 Oct 2012, 09:58 AM
That did it, thanks.
Tags
TileView
Asked by
Hakki
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Hakki
Top achievements
Rank 1
Share this question
or