private void BuildFilesAndFolders() { var xNamespace = XNamespace.Get("http://www.w3.org/2001/XMLSchema-instance"); var xDoc = new XDocument( new XElement("Application", new XAttribute(XNamespace.Xmlns + "xsi", xNamespace), new XAttribute("GeneratedByTileIconifier", true), new XElement("VisualElements", new XAttribute("ShowNameOnSquare150x150Logo", _shortcutItem.Properties.CurrentState.ShowNameOnSquare150X150Logo ? "on" : "off"), new XAttribute("Square150x150Logo", _shortcutItem.RelativeMediumIconPath), new XAttribute("Square70x70Logo", _shortcutItem.RelativeSmallIconPath), new XAttribute("ForegroundText", _shortcutItem.Properties.CurrentState.ForegroundText), new XAttribute("BackgroundColor", _shortcutItem.Properties.CurrentState.BackgroundColor) ))); if (!Directory.Exists(_shortcutItem.VisualElementsPath)) { Directory.CreateDirectory(_shortcutItem.VisualElementsPath); } IoUtils.FileActionRetainingAttributes(_shortcutItem.VisualElementManifestPath, () => xDoc.Save(_shortcutItem.VisualElementManifestPath)); }