Skip to Content
Hidden WPF: Secrets for Creating Great Applications in Windows Presentation Foundation
book

Hidden WPF: Secrets for Creating Great Applications in Windows Presentation Foundation

by Alessandro Del Sole
February 2013
Beginner to intermediate
68 pages
1h 50m
English
Sams
Content preview from Hidden WPF: Secrets for Creating Great Applications in Windows Presentation Foundation

Viewing HTML Files Locally with the Frame Control

The Frame control in WPF allows you to display HTML contents, from both files and pages on the Internet. If you want to display a file, you must assign the Source property with the URI based on the full pathname of the file you want to show. Keep in mind that the pathname is a string, while the Frame.Source property accepts System.Uri. But what about HTML files that are included in the project and published to the same folder of the application? In this case, it’s not possible to use the path where the executable resides, adding the name of the HTML file, because we would get a string where we need the URI.

Imagine you have a file called myFile.htm, which has been added to the project, and now ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4

Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4

Matthew MacDonald
WPF in Action with Visual Studio 2008

WPF in Action with Visual Studio 2008

Arlen Feldman, Maxx Daymon

Publisher Resources

ISBN: 9780133432473