1

I am trying to create a SecondaryTile programmatically in Windows Universal 10, as is mentioned in official doc we can create medium or wide sizes, having different constructors for that:

Creates a SecondaryTile object as a medium tile.

SecondaryTile(String, String, String, String, TileOptions, Uri)

Creates a SecondaryTile object as a wide tile.

SecondaryTile(String, String, String, String, TileOptions, Uri, Uri)

So is there a way to create a second tile to have large size too?

I was trying to update my wide one using large element in visual structure:

 <tile>
  <visual branding="name" displayName="MyTileName">

   <binding template="TileSmall" >
    <!--works after update-->
   </binding>

    <binding template="TileMedium" >
    <!--works after update-->
    </binding>

    <binding template="TileWide">
    <!--works after update-->
    </binding>

    <binding template="TileLarge">
    <!--doesn't work after update-->
    </binding>

  </visual>
</tile>

but no success...

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Choletski
  • 7,074
  • 6
  • 43
  • 64

1 Answers1

1

Those two constructors have been deprecated in Windows 10.

Use the SecondaryTile(), SecondaryTile(string) or SecondaryTile(string, string, string, Uri, TileSize) constructors to instantiate your tile instead, and provide tile images for your desired sizes using the VisualElements property. For example:

var tile = new SecondaryTile(tileId);

// Other secondary tile properties...

tile.VisualElements.Square71x71Logo = new Uri("ms-appx:///Assets/Square71x71Logo.png");
tile.VisualElements.Square150x150Logo = new Uri("ms-appx:///Assets/Square150x150Logo.png");
tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/Wide310x150Logo.png");
tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/Square310x310Logo.png");

When you provide the appropriate tile images, your secondary tile will automatically support resizing and displaying notifications in those sizes. Notice that I provide the large tile image via the Square310x310Logo property — the tile will support resizing to large as a result. Don't forget to set ShowNameOnSquare310x310Logo to true if you want the display name to appear on the large tile.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • 2
    as is mentioned in [docs](https://msdn.microsoft.com/en-us/library/windows/apps/dn251589) `SecondaryTile(string, string, string, Uri, TileSize)` _Creates a SecondaryTile object that includes all of the mandatory properties required to create a medium tile._ and `desiredSize` must be Default (which provides Windows 8 behavior), Square150x150, or Wide310x150. **Any other TileSize value causes an exception to be thrown during runtime** – Choletski Mar 30 '16 at 15:45
  • 1
    @Choletski: When you create a tile and pin it for the first time, you cannot pin it large. You can only pin it medium or wide and give the user the option to make it large after it's pinned. – BoltClock Mar 30 '16 at 15:46
  • the question is about the possibility to make it large by user, in my case it has only 3 aviable sizes – Choletski Mar 30 '16 at 15:47