CoreApplicationView.IsHosted Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the value that indicates whether this app view is hosted.
public:
property bool IsHosted { bool get(); };
bool IsHosted();
public bool IsHosted { get; }
var boolean = coreApplicationView.isHosted;
Public ReadOnly Property IsHosted As Boolean
Property Value
bool
If true, this app view is hosted; if false, it isn't.
Examples
Here's a simple example that demonstrates how to use the IsHosted property:
using Windows.ApplicationModel.Core;
using Windows.UI.Xaml;
namespace ExampleApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
// Check if the current app view is hosted
bool isHosted = CoreApplication.GetCurrentView().IsHosted;
// Display the result
if (isHosted)
{
System.Diagnostics.Debug.WriteLine("The app view is hosted.");
}
else
{
System.Diagnostics.Debug.WriteLine("The app view is not hosted.");
}
}
}
}
Remarks
An app view is hosted when the process that launches it controls its lifetime. For example, the window that opens when a FileOpenPicker is launched is hosted.