Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8404091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:30:36+00:00 2026-06-09T22:30:36+00:00

I would like to be able to pin a hubtile in my application to

  • 0

I would like to be able to pin a hubtile in my application to the start screen, so that the start screen tile has the same animation effects as my hubtile. WHen the user clicks on the pinned hubtile, he or she will be navigated to the correct page. I have followed this example http://igrali.com/2011/09/27/how-to-pin-a-hubtile-to-start-screen/ , but it does not work for me?

MainPage.xaml

<ListBox Grid.Row="0" x:Name="tileList" toolkit:TiltEffect.IsTiltEnabled="True">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <toolkit:WrapPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <toolkit:HubTile Title="{Binding Title}" Margin="3"
                                         Notification="{Binding Notification}"
                                         DisplayNotification="{Binding DisplayNotification}"
                                         Message="{Binding Message}"
                                         GroupTag="{Binding GroupTag}"
                                         Source="{Binding ImageUri}"
                                         Tap="hubTile_Tap">
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu x:Name="menu">
                                    <toolkit:MenuItem Header="pin to start" Tap="MenuItem_Tap"/>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                        </toolkit:HubTile>

                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

MainPage.xaml.cs

public MainPage()
    {
        InitializeComponent();

        CreateHubTiles();
    }

private void CreateHubTiles()
    {
        List<TileItem> tileItems = new List<TileItem>() 
        {
            new TileItem() { ImageUri = "/Images/shareStatusImage.jpg", Title = "status", /*Notification = "last shared link uri",*/ Message = Settings.statusMessage.Value, GroupTag = "TileGroup" },
            new TileItem() { ImageUri = "/Images/shareLinkImage.jpg", Title = "link", /*Notification = "last shared status message",*/ Message = "last shared link uri", GroupTag = "TileGroup" }, 
        };

        this.tileList.ItemsSource = tileItems;
    }

private void MenuItem_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        HubTile tap = sender as HubTile;

        CreateLiveTile(tap);
    }

    private void CreateLiveTile(HubTile hubtile)
    {
        //First create a new StandardTileData object from the hubtile to be pinned

        //NullReferenceException occurs here!!
        StandardTileData LiveTile = new StandardTileData
        {
            BackBackgroundImage = ((System.Windows.Media.Imaging.BitmapImage)hubtile.Source).UriSource,
            Title = hubtile.Title,
            BackTitle = hubtile.Title,
            BackContent = hubtile.Message
        };    

        //Check to see if the tile already exists
        //If not, create it
        //If yes, display messagebox
        ShellTile Tile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("DefaultTitle=" + LiveTile.Title));

        if (Tile == null)
        {
            try
            {
                ShellTile.Create(new Uri("/MainPage.xaml?DefaultTitle=" + LiveTile.Title, UriKind.Relative), LiveTile);
            }
            catch (Exception)
            {
                MessageBox.Show("This tile could not be pinned", "Warning", MessageBoxButton.OK);
            }
        }
        else
        {
            MessageBox.Show("This tile has already been pinned", "Notice", MessageBoxButton.OK);

        }
    }

I am stuck on this and how it could be changed so that it will work!? Also, does this actually place a hubtile on the start screen, or just use the hubtile data to create a secondary tile?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:30:38+00:00Added an answer on June 9, 2026 at 10:30 pm

    I would like to be able to pin a hubtile in my application to the start screen, so that the start screen tile has the same animation effects as my hubtile

    Live tiles for “normal” apps (not first party apps) are limited in what they can do. You can only provide a front/back image, front/back text a back content, and a count. This is all that we have access to.

    UPDATE Adding more info based on error being received
    You can accomplish this by getting your TileItem

    void MenuItem_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        var menuItem = (MenuItem)sender;
        var tileItem = menuItem.DataContext as TileItem;
        CreateLiveTile(tileIte);
    }
    enter code here
    private void CreateLiveTile(TileItem item)
    {
        // use the TileItem, not HubTile.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to be able to create a variable that holds an instance
I would like to emulate the 'Drop Pin' feature in the Maps application. I
I am creating an application using Griffon->SwingBuilder. I would like to able to center
I'm learning Python and would like to start a small project. It seems that
Would like to be able to set colors of headings and such, different font
I would like to be able to output the name of a variable, along
I would like to be able to print in the logs a message for
I would like to be able to show a personal message to abusers of
I would like to be able to go: sed s/^\(\w+\)$/leftside\1rightside/ and have the group
I would like to be able to define a function which accepts an argument

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.