Пример #1
0
        /// <summary>
        /// Set the tile's activation arguments for chasable tile notification.
        /// </summary>
        /// <param name="args">App-Defined custom arguments that will be passed in when the user click on the tile when this tile notification is being displayed.</param>
        /// <param name="size">The tile size that the custom argument should be applied to. Default to all currently supported tile size.</param>
        /// <returns>The current instance of <see cref="TileContentBuilder"/></returns>
        public TileContentBuilder SetActivationArgument(string args, TileSize size = AllSize)
        {
            if (size == AllSize)
            {
                Visual.Arguments = args;
            }
            else
            {
                if (size.HasFlag(TileSize.Small) && SmallTile != null)
                {
                    SmallTile.Arguments = args;
                }

                if (size.HasFlag(TileSize.Medium) && MediumTile != null)
                {
                    MediumTile.Arguments = args;
                }

                if (size.HasFlag(TileSize.Wide) && WideTile != null)
                {
                    WideTile.Arguments = args;
                }

                if (size.HasFlag(TileSize.Large) && LargeTile != null)
                {
                    LargeTile.Arguments = args;
                }
            }

            return(this);
        }
Пример #2
0
        /// <summary>
        /// Set the text stacking (vertical alignment) of the entire binding element.
        /// </summary>
        /// <param name="textStacking">Text Stacking Option</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 SetTextStacking(TileTextStacking textStacking, TileSize size = AllSize)
        {
            // Set to any available tile at the moment of calling.
            if (size.HasFlag(TileSize.Small) && SmallTile != null)
            {
                GetAdaptiveTileContent(SmallTile).TextStacking = textStacking;
            }

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

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

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

            return(this);
        }
Пример #3
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);
        }
Пример #4
0
        /// <summary>
        /// Set the name that will be used to override the application's name on the tile notification.
        /// </summary>
        /// <param name="displayName">Custom name to display on the tile in place of the application's name</param>
        /// <param name="size">The tile size that <paramref name="displayName"/> parameter should be applied to. Default to all currently supported tile size.</param>
        /// <returns>The current instance of <see cref="TileContentBuilder"/></returns>
        public TileContentBuilder SetDisplayName(string displayName, TileSize size = AllSize)
        {
            if (size == AllSize)
            {
                // Set on visual.
                Visual.DisplayName = displayName;
            }
            else
            {
                if (size.HasFlag(TileSize.Small) && SmallTile != null)
                {
                    SmallTile.DisplayName = displayName;
                }

                if (size.HasFlag(TileSize.Medium) && MediumTile != null)
                {
                    MediumTile.DisplayName = displayName;
                }

                if (size.HasFlag(TileSize.Wide) && WideTile != null)
                {
                    WideTile.DisplayName = displayName;
                }

                if (size.HasFlag(TileSize.Large) && LargeTile != null)
                {
                    LargeTile.DisplayName = displayName;
                }
            }

            return(this);
        }
Пример #5
0
        /// <summary>
        /// Set how the tile notification should display the application branding.
        /// </summary>
        /// <param name="branding">How branding should appear on the tile</param>
        /// <param name="size">The tile size that the <paramref name="branding"/> parameter should be applied to. Default to all currently supported tile size.</param>
        /// <returns>The current instance of <see cref="TileContentBuilder"/></returns>
        public TileContentBuilder SetBranding(TileBranding branding, TileSize size = AllSize)
        {
            if (size == AllSize)
            {
                // Set on visual.
                Visual.Branding = branding;
            }
            else
            {
                if (size.HasFlag(TileSize.Small) && SmallTile != null)
                {
                    SmallTile.Branding = branding;
                }

                if (size.HasFlag(TileSize.Medium) && MediumTile != null)
                {
                    MediumTile.Branding = branding;
                }

                if (size.HasFlag(TileSize.Wide) && WideTile != null)
                {
                    WideTile.Branding = branding;
                }

                if (size.HasFlag(TileSize.Large) && LargeTile != null)
                {
                    LargeTile.Branding = branding;
                }
            }

            return(this);
        }
Пример #6
0
        /// <summary>
        /// Add a tile layout size that the notification will be displayed on.
        /// </summary>
        /// <param name="size">The size of tile that the notification will be displayed on.</param>
        /// <param name="tileContent">Specialized tile content. Use for special tile template. Default to NULL.</param>
        /// <returns>The current instance of <see cref="TileContentBuilder"/></returns>
        public TileContentBuilder AddTile(TileSize size, ITileBindingContent tileContent = null)
        {
            if (size.HasFlag(TileSize.Small))
            {
                SmallTile         = new TileBinding();
                SmallTile.Content = tileContent ?? new TileBindingContentAdaptive();
            }

            if (size.HasFlag(TileSize.Medium))
            {
                MediumTile         = new TileBinding();
                MediumTile.Content = tileContent ?? new TileBindingContentAdaptive();
            }

            if (size.HasFlag(TileSize.Wide))
            {
                WideTile         = new TileBinding();
                WideTile.Content = tileContent ?? new TileBindingContentAdaptive();
            }

            if (size.HasFlag(TileSize.Large))
            {
                LargeTile         = new TileBinding();
                LargeTile.Content = tileContent ?? new TileBindingContentAdaptive();
            }

            return(this);
        }
Пример #7
0
        /// <summary>
        /// Add an adaptive child to the tile notification.
        /// </summary>
        /// <param name="child">An adaptive child to add</param>
        /// <param name="size">Tile size that the adaptive child should be added to. Default to all currently supported tile size.</param>
        /// <returns>The current instance of <see cref="TileContentBuilder"/></returns>
        /// <remarks>
        /// This can be used to add Group and Subgroup to the tile.
        /// </remarks>
        public TileContentBuilder AddAdaptiveTileVisualChild(ITileBindingContentAdaptiveChild child, TileSize size = AllSize)
        {
            if (size.HasFlag(TileSize.Small) && SmallTile != null && GetAdaptiveTileContent(SmallTile) != null)
            {
                GetAdaptiveTileContent(SmallTile).Children.Add(child);
            }

            if (size.HasFlag(TileSize.Medium) && MediumTile != null && GetAdaptiveTileContent(MediumTile) != null)
            {
                GetAdaptiveTileContent(MediumTile).Children.Add(child);
            }

            if (size.HasFlag(TileSize.Wide) && WideTile != null && GetAdaptiveTileContent(MediumTile) != null)
            {
                GetAdaptiveTileContent(WideTile).Children.Add(child);
            }

            if (size.HasFlag(TileSize.Large) && LargeTile != null && GetAdaptiveTileContent(LargeTile) != null)
            {
                GetAdaptiveTileContent(LargeTile).Children.Add(child);
            }

            return(this);
        }