Pin tile to Start - unnecessary tile RRS feed

  • Question

  • I have a problem with pinning tile to Start (Windows Store apps, C#)

    I wrote this code to offer user to pin App tile to Start, when app is firstly launched.

    public const string AppbarTileId = "MyAppTile";
    if (!SecondaryTile.Exists(AppbarTileId))         
        Uri square150x150Logo = new Uri(Utils.ImageResources.PinTileToStartMediumImage);
        string tileActivationArguments = AppbarTileId + " was pinned at = " + DateTime.Now.ToLocalTime().ToString();
        string displayName = "MyApp";
        TileSize newTileDesiredSize = TileSize.Square150x150;
        SecondaryTile secondaryTile = new SecondaryTile(AppbarTileId, 
                                                        square150x150Logo, newTileDesiredSize);
        secondaryTile.VisualElements.Square70x70Logo = new Uri(Utils.ImageResources.PinTileToStartSmallImage);
        secondaryTile.VisualElements.Wide310x150Logo = new Uri(Utils.ImageResources.PinTileToStartLargeImage);
        secondaryTile.VisualElements.ShowNameOnWide310x150Logo = true;
        secondaryTile.VisualElements.ForegroundText = ForegroundText.Light;
        double x = this.ActualWidth;
        double y = this.ActualHeight;
        Point point = new Point(x, y);
        Rect rect = new Rect(point, point);
        Windows.UI.Popups.Placement placement = Windows.UI.Popups.Placement.Left;
        bool isPinned = await secondaryTile.RequestCreateForSelectionAsync(rect, placement);

    This is what happens:

    1) When app is being installed, it adds tile to app list.

    2) When user pins tile to Start using my code, it pins my app tile to Start (that’s ok), but it adds the second tile to app list.

    3) If I pin my app tile, using app list tile options, it pins the second tile to Start screen.

    --> So for now I have 2 tiles in the app list and 2 tiles in the Start screen. Can anyone help me with this?

    P.S. Is it possible to add to secondary tile the same options as the original one (I am interested in Uninstall option) 

    Friday, June 5, 2015 12:05 PM