コード例 #1
0
        void UpdateTileWithImage_Click(object sender, RoutedEventArgs e)
        {
            // Note: This sample contains an additional project, NotificationsExtensions.
            // NotificationsExtensions exposes an object model for creating notifications, but you can also
            // modify the strings directly. See UpdateTileWithImageWithStringManipulation_Click for an example

            // Create notification content based on a visual template.
            ITileWideImageAndText01 tileContent = TileContentFactory.CreateTileWideImageAndText01();

            tileContent.TextCaptionWrap.Text = "This tile notification uses ms-appx images";
            tileContent.Image.Src            = "ms-appx:///images/redWide.png";
            tileContent.Image.Alt            = "Red image";

            // Users can resize tiles to square or wide.
            // Apps can choose to include only square assets (meaning the app's tile can never be wide), or
            // include both wide and square assets (the user can resize the tile to square or wide).
            // Apps should not include only wide assets.

            // Apps that support being wide should include square tile notifications since users
            // determine the size of the tile.

            // create the square template and attach it to the wide template
            ITileSquareImage squareContent = TileContentFactory.CreateTileSquareImage();

            squareContent.Image.Src   = "ms-appx:///images/graySquare.png";
            squareContent.Image.Alt   = "Gray image";
            tileContent.SquareContent = squareContent;

            // Send the notification to the app's application tile.
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());

            OutputTextBlock.Text = MainPage.PrettyPrint(tileContent.GetContent());
        }
コード例 #2
0
        void SendTileNotificationWithQueryStrings_Click(object sender, RoutedEventArgs e)
        {
            ITileWideImageAndText01 tileContent = TileContentFactory.CreateTileWideImageAndText01();

            tileContent.TextCaptionWrap.Text = "This tile notification uses query strings for the image src.";

            tileContent.Image.Src = ImageUrl.Text;
            tileContent.Image.Alt = "Web image";

            // enable AddImageQuery on the notification
            tileContent.AddImageQuery = true;

            ITileSquareImage squareContent = TileContentFactory.CreateTileSquareImage();

            squareContent.Image.Src = ImageUrl.Text;
            squareContent.Image.Alt = "Web image";

            // include the square template.
            tileContent.SquareContent = squareContent;

            // send the notification to the app's application tile
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());

            OutputTextBlock.Text = MainPage.PrettyPrint(tileContent.GetContent());
        }
コード例 #3
0
        void UpdateTileWithWebImage()
        {
            ITileWideImageAndText01 tileContent = TileContentFactory.CreateTileWideImageAndText01();

            tileContent.TextCaptionWrap.Text = "高清:撑杆跳伊辛巴耶娃4米70无缘奥运三连冠";

            tileContent.Image.Src = "http://img1.gtimg.com/4/460/46005/4600509_980x1200_292.jpg";
            tileContent.Image.Alt = "Web image";

            ITileSquareImage squareContent = TileContentFactory.CreateTileSquareImage();

            squareContent.Image.Src = "http://img1.gtimg.com/4/460/46005/4600509_980x1200_292.jpg";
            squareContent.Image.Alt = "Web image";

            tileContent.SquareContent = squareContent;

            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());
        }
コード例 #4
0
        void UpdateTileWithWebImage_Click(object sender, RoutedEventArgs e)
        {
            // Note: This sample contains an additional project, NotificationsExtensions.
            // NotificationsExtensions exposes an object model for creating notifications, but you can also
            // modify the strings directly. See UpdateTileWithWebImageWithStringManipulation_Click for an example

            // Create notification content based on a visual template.
            ITileWideImageAndText01 tileContent = TileContentFactory.CreateTileWideImageAndText01();

            tileContent.TextCaptionWrap.Text = "This tile notification uses web images.";

            // !Important!
            // The Internet (Client) capability must be checked in the manifest in the Capabilities tab
            // to display web images in tiles (either the http:// or https:// protocols)

            tileContent.Image.Src = ImageUrl.Text;
            tileContent.Image.Alt = "Web image";

            // Users can resize tiles to square or wide.
            // Apps can choose to include only square assets (meaning the app's tile can never be wide), or
            // include both wide and square assets (the user can resize the tile to square or wide).
            // Apps cannot include only wide assets.

            // Apps that support being wide should include square tile notifications since users
            // determine the size of the tile.

            // Create square notification content based on a visual template.
            ITileSquareImage squareContent = TileContentFactory.CreateTileSquareImage();

            squareContent.Image.Src = ImageUrl.Text;
            squareContent.Image.Alt = "Web image";

            // include the square template.
            tileContent.SquareContent = squareContent;

            // send the notification to the app's application tile
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());

            OutputTextBlock.Text = MainPage.PrettyPrint(tileContent.GetContent());
        }
コード例 #5
0
ファイル: CreateLiveTile.cs プロジェクト: supradha/Kraken_Me
        public static void ShowliveTile(bool IsLiveTile1, string name)
        {
            string wideTilesrc  = "ms-appx:///Assets/BigLiveTile1.jpg";
            string smallTilesrc = "ms-appx:///Assets/SmallLiveTile1.jpg";

            if (!IsLiveTile1)
            {
                wideTilesrc  = "ms-appx:///Assets/BigLiveTile2.jpg";
                smallTilesrc = "ms-appx:///Assets/SmallLiveTile2.jpg";
            }
            // Note: This sample contains an additional project, NotificationsExtensions.
            // NotificationsExtensions exposes an object model for creating notifications, but you can also
            // modify the strings directly. See UpdateTileWithImageWithStringManipulation_Click for an example

            // Create notification content based on a visual template.
            ITileWideImageAndText01 tileContent = TileContentFactory.CreateTileWideImageAndText01();

            tileContent.TextCaptionWrap.Text = name;
            tileContent.Image.Src            = wideTilesrc;
            tileContent.Image.Alt            = "Live tile";

            // Users can resize tiles to square or wide.
            // Apps can choose to include only square assets (meaning the app's tile can never be wide), or
            // include both wide and square assets (the user can resize the tile to square or wide).
            // Apps should not include only wide assets.

            // Apps that support being wide should include square tile notifications since users
            // determine the size of the tile.

            // create the square template and attach it to the wide template
            ITileSquareImage squareContent = TileContentFactory.CreateTileSquareImage();

            squareContent.Image.Src   = smallTilesrc;
            squareContent.Image.Alt   = "Live tile";
            tileContent.SquareContent = squareContent;

            // Send the notification to the app's application tile.
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());
        }
コード例 #6
0
        void SendTileNotification_Click(object sender, RoutedEventArgs e)
        {
            string scale;

            ResourceManager.Current.DefaultContext.QualifierValues.TryGetValue("Scale", out scale);

            ITileWideSmallImageAndText03 tileContent = TileContentFactory.CreateTileWideSmallImageAndText03();

            tileContent.TextBodyWrap.Text = "graySquare.png in the xml is actually graySquare.scale-" + scale + ".png";
            tileContent.Image.Src         = "ms-appx:///images/graySquare.png";
            tileContent.Image.Alt         = "Gray square";

            ITileSquareImage squareTileContent = TileContentFactory.CreateTileSquareImage();

            squareTileContent.Image.Src = "ms-appx:///images/graySquare.png";
            squareTileContent.Image.Alt = "Gray square";
            tileContent.SquareContent   = squareTileContent;

            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());

            OutputTextBlock.Text = MainPage.PrettyPrint(tileContent.GetContent());
        }