示例#1
0
        /// <summary>
        /// Set the Tile's Peek Image that animate from the top of the tile notification.
        /// </summary>
        /// <param name="peekImage">An instance of <see cref="TilePeekImage"/> for the Tile's peek image </param>
        /// <param name="size">The tile size that the peek image should be applied to. Default to all currently supported tile size.</param>
        /// <returns>The current instance of <see cref="TileContentBuilder"/></returns>
        public TileContentBuilder SetPeekImage(TilePeekImage peekImage, TileSize size = AllSize)
        {
            // Set to any available tile at the moment of calling.
            if (size.HasFlag(TileSize.Small) && SmallTile != null)
            {
                GetAdaptiveTileContent(SmallTile).PeekImage = peekImage;
            }

            if (size.HasFlag(TileSize.Medium) && MediumTile != null)
            {
                GetAdaptiveTileContent(MediumTile).PeekImage = peekImage;
            }

            if (size.HasFlag(TileSize.Wide) && WideTile != null)
            {
                GetAdaptiveTileContent(WideTile).PeekImage = peekImage;
            }

            if (size.HasFlag(TileSize.Large) && LargeTile != null)
            {
                GetAdaptiveTileContent(LargeTile).PeekImage = peekImage;
            }

            return(this);
        }
示例#2
0
        /// <summary>
        /// Set the Tile's Peek Image that animate from the top of the tile notification.
        /// </summary>
        /// <param name="imageUri">Source of the peek image</param>
        /// <param name="size">The tile size that the peek image should be applied to. Default to all currently supported tile size.</param>
        /// <param name="alternateText">Description of the peek image, for user of assistance technology</param>
        /// <param name="addImageQuery">
        /// Indicating whether Windows should append a query string to the image URI supplied in the Tile notification.
        /// Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string.
        /// This query string specifies scale, contrast setting, and language.
        /// </param>
        /// <param name="hintOverlay">The opacity of the black overlay on the peek image.</param>
        /// <param name="hintCrop">Desired cropping of the image.</param>
        /// <returns>The current instance of <see cref="TileContentBuilder"/></returns>
        public TileContentBuilder SetPeekImage(Uri imageUri, TileSize size = AllSize, string alternateText = default(string), bool?addImageQuery = default(bool?), int?hintOverlay = default(int?), TilePeekImageCrop hintCrop = TilePeekImageCrop.Default)
        {
            TilePeekImage peekImage = new TilePeekImage();

            peekImage.Source   = imageUri.OriginalString;
            peekImage.HintCrop = hintCrop;

            if (alternateText != default(string))
            {
                peekImage.AlternateText = alternateText;
            }

            if (addImageQuery != default(bool?))
            {
                peekImage.AddImageQuery = addImageQuery;
            }

            if (hintOverlay != default(int?))
            {
                peekImage.HintOverlay = hintOverlay;
            }

            return(SetPeekImage(peekImage, size));
        }