--- title: "How to: Determine If a Page is Browser Hosted" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "hosted pages in browser [WPF]" - "pages [WPF], hosted in browser" ms.assetid: 737e0f26-8371-49b4-9579-70879e51e1aa --- # How to: Determine If a Page is Browser Hosted This example demonstrates how to determine if a is hosted in a browser. ## Example A can be host agnostic and, consequently, can be loaded into several different types of hosts, including a , a , or a browser. This can happen when you have a library assembly that contains one or more pages, and which is referenced by multiple standalone and browsable (XAML browser application (XBAP)) host applications. The following example demonstrates how to use to determine if a is hosted in a browser. [!code-csharp[HOWTOBrowserInteropHelperSnippets#IsBrowserHostedCODE](~/samples/snippets/csharp/VS_Snippets_Wpf/HOWTOBrowserInteropHelperSnippets/CSharp/Page1.xaml.cs#isbrowserhostedcode)] [!code-vb[HOWTOBrowserInteropHelperSnippets#IsBrowserHostedCODE](~/samples/snippets/visualbasic/VS_Snippets_Wpf/HOWTOBrowserInteropHelperSnippets/visualbasic/page1.xaml.vb#isbrowserhostedcode)] ## See also - -