CoreApplicationView
CoreApplicationView
CoreApplicationView
CoreApplicationView
Class
Definition
Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Prerelease APIs are identified by a Prerelease label.
[Contains prerelease APIs.]
Represents an app window and its thread.
public : sealed class CoreApplicationView : ICoreApplicationView, ICoreApplicationView2, ICoreApplicationView3, ICoreApplicationView5, ICoreApplicationView6public sealed class CoreApplicationView : ICoreApplicationView, ICoreApplicationView2, ICoreApplicationView3, ICoreApplicationView5, ICoreApplicationView6Public NotInheritable Class CoreApplicationView Implements ICoreApplicationView, ICoreApplicationView2, ICoreApplicationView3, ICoreApplicationView5, ICoreApplicationView6// This API is not available in Javascript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
Note
This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).
The following code snippet demonstrates the activation of the CoreApplicationView and the associated CoreWindow in a view provider implementation.
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();
}
// ...
}
Properties
CoreWindow CoreWindow CoreWindow CoreWindow
Gets the app window associated with the current view.
public : CoreWindow CoreWindow { get; }public CoreWindow CoreWindow { get; }Public ReadOnly Property CoreWindow As CoreWindow// This API is not available in Javascript.
The app window.
Dispatcher Dispatcher Dispatcher Dispatcher
Gets the event message dispatcher associated with the current view.
public : CoreDispatcher Dispatcher { get; }public CoreDispatcher Dispatcher { get; }Public ReadOnly Property Dispatcher As CoreDispatcher// This API is not available in Javascript.
The event message dispatcher.
DispatcherQueue DispatcherQueue DispatcherQueue DispatcherQueue
Prerelease. Gets the DispatcherQueue for the window.
public : DispatcherQueue DispatcherQueue { get; }public DispatcherQueue DispatcherQueue { get; }Public ReadOnly Property DispatcherQueue As DispatcherQueue// This API is not available in Javascript.
A DispatcherQueue instance.
| Device family |
Windows 10 Insider Preview (introduced v10.0.16257.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v5)
|
Remarks
The DispatcherQueue allows you to run your tasks on the thread associated with the DispatcherQueue instance. To make UI changes on a CoreApplicationView from a different thread, use the DispatcherQueue from that CoreApplicationView.
IsComponent IsComponent IsComponent IsComponent
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.
public : PlatForm::Boolean IsComponent { get; }public bool IsComponent { get; }Public ReadOnly Property IsComponent As bool// This API is not available in Javascript.
- Value
- PlatForm::Boolean bool bool bool
True if the app was launched as a component that is embedded in another app; false otherwise.
IsHosted IsHosted IsHosted IsHosted
Gets the value that indicates whether this app view is hosted or not.
public : PlatForm::Boolean IsHosted { get; }public bool IsHosted { get; }Public ReadOnly Property IsHosted As bool// This API is not available in Javascript.
- Value
- PlatForm::Boolean bool bool bool
If true, this app view is hosted; if false, it is not.
IsMain IsMain IsMain IsMain
Gets a value that indicates whether this app view is the main app view or not.
public : PlatForm::Boolean IsMain { get; }public bool IsMain { get; }Public ReadOnly Property IsMain As bool// This API is not available in Javascript.
- Value
- PlatForm::Boolean bool bool bool
If true, this app view is the main; if false, it is not.
Properties Properties Properties Properties
Gets properties that the app can associate with the view.
public : IPropertySet Properties { get; }public IPropertySet Properties { get; }Public ReadOnly Property Properties As IPropertySet// This API is not available in Javascript.
The property bag.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
Properties stored here are guaranteed to have a lifetime equal to the CoreApplicationView.
TitleBar TitleBar TitleBar TitleBar
Gets the title bar associated with the current view.
public : CoreApplicationViewTitleBar TitleBar { get; }public CoreApplicationViewTitleBar TitleBar { get; }Public ReadOnly Property TitleBar As CoreApplicationViewTitleBar// This API is not available in Javascript.
- Value
- CoreApplicationViewTitleBar CoreApplicationViewTitleBar CoreApplicationViewTitleBar CoreApplicationViewTitleBar
The title bar associated with the current view.
Events
Activated Activated Activated Activated
Occurs when the view is activated.
public : event TypedEventHandler Activated<CoreApplicationView, IActivatedEventArgs>public event TypedEventHandler Activated<CoreApplicationView, IActivatedEventArgs>Public Event Activated<CoreApplicationView, IActivatedEventArgs>// This API is not available in Javascript.
- See Also
HostedViewClosing HostedViewClosing HostedViewClosing HostedViewClosing
Indicates that the hosted view is closing. Provides an opportunity for hosted window scenarios to defer the tear down of the hosted view.
public : event TypedEventHandler HostedViewClosing<CoreApplicationView, HostedViewClosingEventArgs>public event TypedEventHandler HostedViewClosing<CoreApplicationView, HostedViewClosingEventArgs>Public Event HostedViewClosing<CoreApplicationView, HostedViewClosingEventArgs>// This API is not available in Javascript.
Remarks
Handling this event provides an opportunity to perform cleanup tasks such as closing files, flushing buffers to disk, and so on.