CoreApplicationView Class
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.
Represents an app window and its thread.
public ref class CoreApplicationView sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class CoreApplicationView final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class CoreApplicationView
Public NotInheritable Class CoreApplicationView
- Inheritance
- Attributes
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
The following code snippet demonstrates the activation of the CoreApplicationView and the associated CoreWindow in a view provider implementation.
struct App : implements<App, IFrameworkViewSource, IFrameworkView>
{
...
void Initialize(CoreApplicationView const& applicationView)
{
applicationView.Activated({this, &App::OnActivated });
}
void OnActivated(CoreApplicationView const& /* applicationView */, IActivatedEventArgs const& /* args */)
{
// Activate the application window, making it visible and enabling it to receive events.
CoreWindow::GetForCurrentThread().Activate();
}
}
ref class MyFrameworkView : public IFrameworkView
{
// ...
virtual void Initialize(
_In_ CoreApplicationView^ applicationView
)
{
applicationView->Activated +=
ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &MyFrameworkView::OnActivated);
}
// ...
void OnActivated(
_In_ CoreApplicationView^ applicationView,
_In_ IActivatedEventArgs^ args
)
{
// Activate the application window, making it visible and enabling it to receive events.
CoreWindow::GetForCurrentThread()->Activate();
}
// ...
}
Windows version | SDK version | Value added |
---|---|---|
1703 | 15063 | Properties |
1709 | 16299 | DispatcherQueue |
Core |
Gets the app window associated with the current view. |
Dispatcher |
Gets the event message dispatcher associated with the current view. |
Dispatcher |
Gets the DispatcherQueue for the window. |
Is |
Gets whether the app was launched as a component that is embedded in another app. This property is reserved for internal use and is not intended to be used in your code. |
Is |
Gets the value that indicates whether this app view is hosted or not. |
Is |
Gets a value that indicates whether this app view is the main app view or not. |
Properties |
Gets properties that the app can associate with the view. |
Title |
Gets the title bar associated with the current view. |
Activated |
Occurs when the view is activated. |
Hosted |
Indicates that the hosted view is closing. Provides an opportunity for hosted window scenarios to defer the tear down of the hosted view. |
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |