maha
maha

Reputation: 67

how to display the output in the screen?

I coded everything, when I run the project it's not showing the output on the screen. Can anybody tell me, what's the code used to display the output on the screen?

It is the code used in my (not console) application.

private async void Button_Click_1(object sender, RoutedEventArgs e) {
    StorageFile xmlFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("Content1.xml");
    XmlDocument xmlDoc;
    xmlDoc = await XmlDocument.LoadFromFileAsync(xmlFile);
    System.Xml.Linq.XDocument duc = System.Xml.Linq.XDocument.Parse(xmlDoc.GetXml());

    var query=
        from Date in duc.Root.Elements("Serial")
        where Date.Attribute("No").Value=="1"
        from Current in Date.Elements("Current")
        select new {
            NarratedBy=Current.Attribute("NarratedBy").Value,
            value=Current.Attribute("Date").Value
        };

    foreach(var Date in query) {
        System.Diagnostics.Debug.WriteLine("{0}\t{1}", Date.NarratedBy, Date.value);
    }
}

Upvotes: 1

Views: 1296

Answers (1)

Adil
Adil

Reputation: 148110

You can use multiline TextBox or RichTextBox and TextBlock and append the text to it display and use String.Format to format text.

TextBox1 +=  String.Format("{0}\t{1}", Date.NarratedBy, Date.value) + Environment.NewLine;

Upvotes: 2

Related Questions