C# – WPF – Flow Document – Document with C#

With the current article I will show you how to create a simple application, presenting yourself. The most of the application is created in XAML. Roughly, it looks like this:



The text is from here. This application is really easy for creation, as far as most of the job is already done within the engine of XAML, using the tags “FlowDocumentReader” and “FlowDocument”. With these tags you get the nice search options, the scroller and the different views. So, the only thing left is to set the paragraphs and to edit the text a little as follows:

And that is it. In order to make it fancier, we may assign some actions to the buttons as follows:

> if a button “N” is pressed, you will get the following message, added to the text: “Please, visit my site: www.vitoshacademy.com & like it in google :)”.

> if a button “A” is pressed, you get the following at the end of the first paragraph: “You may add text here as well :)”

This is the C# code, which makes these two functions:

Last but not least, if you want to take a look at the application without messing with the code, you may take a look from here.

Enjoy it!

Tagged with: , , , ,