Esempio n. 1
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);
        }
Esempio n. 2
0
 private static IElement_TileBindingChild ConvertToBindingChildElement(ITileBindingContentAdaptiveChild child)
 {
     return((IElement_TileBindingChild)AdaptiveHelper.ConvertToElement(child));
 }