How to Position Content on a WPF Web Browser
The Windows Presentation Foundation (WPF) development environment includes a Web browser you use to test and debug your applications. You use standard HTML to position the application and use the WPF code to add the application to the Web browser view. After you launch the site, WPF uses the coded information to position the application on your user's browser.
Instructions
-
-
1
Launch your WPF editor by navigating to the "Start" menu and "All Programs." Open the WPF project that you want to test.
-
2
Add the "center" HTML tag. The "center" tag positions the site in the center of the browser. The following code is the syntax for the center tag:
<center> </center>
-
-
3
Add the application inclusion directive to load the app in the browser. Add the following code within your center tag:
<Application x:Class="MyApp" />
<HostInBrowser>True</HostInBrowser>Replace "MyApp" with the name of your WPF app.
-
4
Save the changes and click "Run" to execute the code in your WPF browser for testing.
-
1
Tips & Warnings
You can also align the app to the left or right of the browser. The CSS "left" and "right" place the app on either side of the browser.