locked
Secondary Tuiles on Win Store app

    Question

  • hi,

    i'm developping a windows store app using visual studio 2013 (c# and XAML) and i want to create secondary tuiles. i searched on the net and all i found is XML code. does any one have any idea about creating tuiles using XAML???

    Thanks for advance

    Thursday, March 20, 2014 9:18 AM

Answers

  • ahh oke that makes more clear.

    in xaml:

    <GridViewItem Width="310" Height="150" Background="red" Tapped="GridViewItem_Tapped">
                <TextBlock Text="My Tile" />
            </GridViewItem>

    and in c#

    private void GridViewItem_Tapped(object sender, TappedRoutedEventArgs e)
            {
                Frame.Navigate(typeof(YourOtherPage));
            }

    ofcourse you have to change the typeof(YourOtherPage) to your page


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, March 20, 2014 10:28 AM
  • do you have your tiles alreday visible with a gridview?

    for now i assume you dealt with your gridview because you talking about selected item:

    then you need to add these two attributes:

    <GridView IsItemClickEnabled="True" ItemClick="GridView_ItemClick" />

    and in code:

            private void GridView_ItemClick(object sender, ItemClickEventArgs e)
            {
                var item = e.ClickedItem;
                // 
    
                Frame.Navigate()
            }

    since i am not sure what is your click item you will need some logic there to figure that out and switch to the right view.


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, March 20, 2014 10:41 AM

All replies

  • live tiles are Always based on xml content. to create a static secondary tile you only need an image and code. not xaml or xml.

    see : http://code.msdn.microsoft.com/windowsapps/Secondary-Tiles-Sample-edf2a178


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, March 20, 2014 10:05 AM
  • thanks but it's not what i'm looking for 

    i want to create a simple tile  

    when i click to it, i see another page

    Thursday, March 20, 2014 10:14 AM
  • you mean a tile in side your app? or really a secondary tile thats on the startscreen?

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, March 20, 2014 10:15 AM
  • a tile inside my app

    i want to use like a button to switch between pages

    Thursday, March 20, 2014 10:21 AM
  • ahh oke that makes more clear.

    in xaml:

    <GridViewItem Width="310" Height="150" Background="red" Tapped="GridViewItem_Tapped">
                <TextBlock Text="My Tile" />
            </GridViewItem>

    and in c#

    private void GridViewItem_Tapped(object sender, TappedRoutedEventArgs e)
            {
                Frame.Navigate(typeof(YourOtherPage));
            }

    ofcourse you have to change the typeof(YourOtherPage) to your page


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, March 20, 2014 10:28 AM
  • thanks a lot, but each item go to a diffrent page how can i do it with selecteditem???
    Thursday, March 20, 2014 10:34 AM
  • do you have your tiles alreday visible with a gridview?

    for now i assume you dealt with your gridview because you talking about selected item:

    then you need to add these two attributes:

    <GridView IsItemClickEnabled="True" ItemClick="GridView_ItemClick" />

    and in code:

            private void GridView_ItemClick(object sender, ItemClickEventArgs e)
            {
                var item = e.ClickedItem;
                // 
    
                Frame.Navigate()
            }

    since i am not sure what is your click item you will need some logic there to figure that out and switch to the right view.


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, March 20, 2014 10:41 AM
  • thanks a lot thank you sir
    Thursday, March 20, 2014 10:42 AM