Windows.Data.Xml.Dom.XmlDocument.AppendChild C# (CSharp) Method

AppendChild() public method

public AppendChild ( [ newChild ) : IXmlNode
newChild [
return IXmlNode
		public extern IXmlNode AppendChild([In] IXmlNode newChild);
		public extern IXmlNode CloneNode([In] bool deep);

Usage Example

        /// <summary>
        /// Set the application's tile to display a local image file.
        /// After clicking, go back to the start screen to watch your application's tile update.
        /// </summary>
        private void SetTileImageButtonClick(object sender, RoutedEventArgs e)
        {
            // It is possible to start from an existing template and modify what is needed.
            // Alternatively you can construct the XML from scratch.
            var tileXml = new XmlDocument();
            var title = tileXml.CreateElement("title");
            var visual = tileXml.CreateElement("visual");
            visual.SetAttribute("version", "1");
            visual.SetAttribute("lang", "en-US");

            // The template is set to be a TileSquareImage. This tells the tile update manager what to expect next.
            var binding = tileXml.CreateElement("binding");
            binding.SetAttribute("template", "TileSquareImage");
            // An image element is then created under the TileSquareImage XML node. The path to the image is specified
            var image = tileXml.CreateElement("image");
            image.SetAttribute("id", "1");
            image.SetAttribute("src", @"ms-appx:///Assets/DemoImage.png");

            // All the XML elements are chained up together.
            title.AppendChild(visual);
            visual.AppendChild(binding);
            binding.AppendChild(image);
            tileXml.AppendChild(title);

            // The XML is used to create a new TileNotification which is then sent to the TileUpdateManager
            var tileNotification = new TileNotification(tileXml);
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
        }
All Usage Examples Of Windows.Data.Xml.Dom.XmlDocument::AppendChild