Windows8 TileWithText && TileWithImage

        private TileUpdater tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();

        private void TileWithText_Click(object sender, RoutedEventArgs e)
        {
            ITileWideText03 tileContent = TileContentFactory.CreateTileWideText03();//tileContent
            tileContent.TextHeadingWrap.Text = "Hello World! My own tile notification";


            ITileSquareText04 squareContent = TileContentFactory.CreateTileSquareText04();//squareContent
            squareContent.TextBodyWrap.Text = "Hello World! My own tile notification";
            tileContent.SquareContent = squareContent;

            TileNotification tileNotification = tileContent.CreateNotification();
            tileUpdater.Update(tileNotification);
        }

        void TileWithImage_Click(object sender, RoutedEventArgs e)
        {
            ITileWideImageAndText01 tileContent = TileContentFactory.CreateTileWideImageAndText01();
            tileContent.TextCaptionWrap.Text = "Image Tile";
            tileContent.Image.Src = "Tennis.jpg";
            tileContent.Image.Alt = "Red image";

            ITileSquareImage squareContent = TileContentFactory.CreateTileSquareImage();
            squareContent.Image.Src = "Tennis.jpg";
            squareContent.Image.Alt = "Gray image";
            tileContent.SquareContent = squareContent;

            TileNotification tileNotification = tileContent.CreateNotification();
            tileUpdater.Update(tileNotification);
        }

        private void ClearTile_Click(object sender, RoutedEventArgs e)
        {
            tileUpdater.Clear();
        }

 

posted on 2013-03-28 13:50  JackSlaterYu  阅读(140)  评论(0编辑  收藏  举报