dpreznik
dpreznik

Reputation: 247

How to display an xhtml file?

I have a TreeView that represents a book. Each chapter of the book is in xhtml format (unzipped from epub). The paths of the chapters are stored as Tags of the TreeView items. I need to display a selected chapter upon click on a TreeView element.

Could you please tell what is the best way to display an xhtml document? What control is the best for this purpose?

Upvotes: 0

Views: 940

Answers (2)

Ucodia
Ucodia

Reputation: 7710

You can use the a WebBrowser control and then set the Source property to your XHTML file url. If the tag is not pointing to a XHTML file but directly to raw HTML text, you maybe need to create this file as the Source property is a Uri object.

That is definitely the way to display HTML in WPF.

Upvotes: 1

Pankaj Upadhyay
Pankaj Upadhyay

Reputation: 13584

Microsoft has a demo of how to convert XAML to XHTML and vice-versa. This should get you most of the way to where you're going.

Upvotes: 0

Related Questions