Listparagraphs = new List (); // ... int count = paragraphs.Count; Console.WriteLine("There are {0} paragraphs in the list.", count);
FlowDocument document = new FlowDocument(); // ... int count = document.Blocks.Count; Console.WriteLine("There are {0} blocks in the document.", count);This example creates a FlowDocument and retrieves the count of Block elements in the document. The System.Windows.Documents namespace is part of the WPF (Windows Presentation Foundation) framework, which is included in the .NET Framework.