コード例 #1
0
        /// <summary>
        /// TileWideSmallImageAndText02
        /// On the left, one small image; on the right, one header string in larger text on the first line over four strings of regular text on the next four lines. Text does not wrap.
        /// http://msdn.microsoft.com/en-us/library/windows/apps/hh761491#TileWideSmallImageAndText02
        ///
        /// TileSquarePeekImageAndText02
        /// Top: Square image, no text. Bottom: One header string in larger text on the first line, over one string of regular text wrapped over a maximum of three lines.
        /// http://msdn.microsoft.com/en-us/library/windows/apps/hh761491#TileSquarePeekImageAndText02
        /// </summary>
        /// <param name="item"></param>
        private static void CreateSeconderyNoteBook(NoteBook item)
        {
            var imgUrl     = GetPreviewImage(item, false).ToString();
            var imgWideUrl = GetPreviewImage(item, true).ToString();

            ITileWide310x150SmallImageAndText02 tileContent = TileContentFactory.CreateTileWide310x150SmallImageAndText02();

            tileContent.TextHeading.Text = item.Title;
            var count = item.Items.Count < 4 ? item.Items.Count : 4;

            for (var i = 0; i < count; i++)
            {
                var noteTitle = item.Items[i].Title;
                switch (i)
                {
                case 0:
                    tileContent.TextBody1.Text = noteTitle;
                    break;

                case 1:
                    tileContent.TextBody2.Text = noteTitle;
                    break;

                case 2:
                    tileContent.TextBody3.Text = noteTitle;
                    break;

                case 3:
                    tileContent.TextBody3.Text = noteTitle;
                    break;
                }
            }

            tileContent.Image.Src = imgWideUrl;
            tileContent.Image.Alt = item.Title;

            tileContent.Branding = TileBranding.Name;

            ITileSquare150x150PeekImageAndText02 squareTileContent = TileContentFactory.CreateTileSquare150x150PeekImageAndText02();

            squareTileContent.Image.Src         = imgUrl;
            squareTileContent.Image.Alt         = item.Title;
            squareTileContent.TextHeading.Text  = item.Title;
            squareTileContent.TextBodyWrap.Text = item.Description.Equals(Consts.DefaultDescriptionText) ? string.Empty : item.Description.ToShortString();
            tileContent.Square150x150Content    = squareTileContent;

            TileUpdateManager.CreateTileUpdaterForSecondaryTile(item.UniqueId).Update(tileContent.CreateNotification());
        }
コード例 #2
0
        /// <summary>
        /// TileWideSmallImageAndText04
        /// On the left, one small image; on the right, one header string of larger text on the first line over one string of regular text wrapped over a maximum of four lines.
        /// http://msdn.microsoft.com/en-us/library/windows/apps/hh761491#TileWideSmallImageAndText04
        ///
        /// TileSquarePeekImageAndText02
        /// Top: Square image, no text. Bottom: One header string in larger text on the first line, over one string of regular text wrapped over a maximum of three lines.
        /// http://msdn.microsoft.com/en-us/library/windows/apps/hh761491#TileSquarePeekImageAndText02
        /// </summary>
        /// <param name="item"></param>
        private static void CreateSeconderyWithImage(NoteDataCommon item)
        {
            var imgUrl     = GetPreviewImage(item, false).ToString();
            var imgWideUrl = GetPreviewImage(item, true).ToString();

            ITileWide310x150SmallImageAndText04 tileContent = TileContentFactory.CreateTileWide310x150SmallImageAndText04();

            tileContent.TextHeading.Text  = item.Title;
            tileContent.TextBodyWrap.Text = item.Description.Equals(Consts.DefaultDescriptionText) ? string.Empty : item.Description.ToShortString();
            tileContent.Image.Src         = imgWideUrl;
            tileContent.Image.Alt         = item.Title;

            ITileSquare150x150PeekImageAndText02 squareTileContent = TileContentFactory.CreateTileSquare150x150PeekImageAndText02();

            squareTileContent.Image.Src         = imgUrl;
            squareTileContent.Image.Alt         = item.Title;
            squareTileContent.TextHeading.Text  = item.Title;
            squareTileContent.TextBodyWrap.Text = item.Description.Equals(Consts.DefaultDescriptionText) ? string.Empty : item.Description.ToShortString();
            tileContent.Square150x150Content    = squareTileContent;

            tileContent.Branding = TileBranding.Name;
            TileUpdateManager.CreateTileUpdaterForSecondaryTile(item.UniqueId).Update(tileContent.CreateNotification());
        }