ProjectionManager ProjectionManager ProjectionManager ProjectionManager Class

Definition

Defines a set of methods for managing the windows (app views) sent to secondary displays, such as projectors.

public : static class ProjectionManager
public static class ProjectionManager
Public Static Class ProjectionManager
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

ProjectionDisplayAvailable ProjectionDisplayAvailable ProjectionDisplayAvailable ProjectionDisplayAvailable

Gets whether or not a projection display is available to use.

public : static Platform::Boolean ProjectionDisplayAvailable { get; }
public static bool ProjectionDisplayAvailable { get; }
Public Static ReadOnly Property ProjectionDisplayAvailable As bool
var bool = Windows.UI.ViewManagement.ProjectionManager.projectionDisplayAvailable;
Value
Platform::Boolean bool bool bool

true if a projection display is available on the current computer; false if it is not.

Methods

GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector()

Returns a string that is used to enumerate device services.

public : static Platform::String GetDeviceSelector()
public static string GetDeviceSelector()
Public Static Function GetDeviceSelector() As string
var string = Windows.UI.ViewManagement.ProjectionManager.getDeviceSelector();
Returns
Platform::String string string string

A string that is used to enumerate device services.

RequestStartProjectingAsync(Int32, Int32, Rect) RequestStartProjectingAsync(Int32, Int32, Rect) RequestStartProjectingAsync(Int32, Int32, Rect) RequestStartProjectingAsync(Int32, Int32, Rect)

Makes a request to asynchronously sends a window (app view) to the projector or other secondary display.

public : static IAsyncOperation<Platform::Boolean> RequestStartProjectingAsync(int projectionViewId, int anchorViewId, Rect selection)
public static IAsyncOperation<bool> RequestStartProjectingAsync(Int32 projectionViewId, Int32 anchorViewId, Rect selection)
Public Static Function RequestStartProjectingAsync(projectionViewId As Int32, anchorViewId As Int32, selection As Rect) As IAsyncOperation( Of bool )
Windows.UI.ViewManagement.ProjectionManager.requestStartProjectingAsync(projectionViewId, anchorViewId, selection).done( /* Your success and error handlers */ );
Parameters
projectionViewId
int Int32 Int32 Int32

The new ID of the window to be displayed by the projector or other secondary display.

anchorViewId
int Int32 Int32 Int32

The ID of the original window before projection.

selection
Rect Rect Rect Rect

The area to one side of which the flyout is displayed.

Returns

true if projection started; otherwise, false.

See Also

RequestStartProjectingAsync(Int32, Int32, Rect, Placement) RequestStartProjectingAsync(Int32, Int32, Rect, Placement) RequestStartProjectingAsync(Int32, Int32, Rect, Placement) RequestStartProjectingAsync(Int32, Int32, Rect, Placement)

Makes a request to asynchronously sends a window (app view) to the projector or other secondary display with the specified preferred placement.

public : static IAsyncOperation<Platform::Boolean> RequestStartProjectingAsync(int projectionViewId, int anchorViewId, Rect selection, Placement prefferedPlacement)
public static IAsyncOperation<bool> RequestStartProjectingAsync(Int32 projectionViewId, Int32 anchorViewId, Rect selection, Placement prefferedPlacement)
Public Static Function RequestStartProjectingAsync(projectionViewId As Int32, anchorViewId As Int32, selection As Rect, prefferedPlacement As Placement) As IAsyncOperation( Of bool )
Windows.UI.ViewManagement.ProjectionManager.requestStartProjectingAsync(projectionViewId, anchorViewId, selection, prefferedPlacement).done( /* Your success and error handlers */ );
Parameters
projectionViewId
int Int32 Int32 Int32

The new ID of the window to be displayed by the projector or other secondary display.

anchorViewId
int Int32 Int32 Int32

The ID of the original window before projection.

selection
Rect Rect Rect Rect

The area to one side of which the flyout is displayed.

prefferedPlacement
Placement Placement Placement Placement

The side of the rectangle where the flyout should appear.

Returns

true if projection started; otherwise, false.

See Also

StartProjectingAsync(Int32, Int32) StartProjectingAsync(Int32, Int32) StartProjectingAsync(Int32, Int32) StartProjectingAsync(Int32, Int32)

Asynchronously sends a window (app view) to the projector or other secondary display.

public : static IAsyncAction StartProjectingAsync(int projectionViewId, int anchorViewId)
public static IAsyncAction StartProjectingAsync(Int32 projectionViewId, Int32 anchorViewId)
Public Static Function StartProjectingAsync(projectionViewId As Int32, anchorViewId As Int32) As IAsyncAction
Windows.UI.ViewManagement.ProjectionManager.startProjectingAsync(projectionViewId, anchorViewId).done( /* Your success and error handlers */ );
Parameters
projectionViewId
int Int32 Int32 Int32

The new ID of the window to be displayed by the projector or other secondary display.

anchorViewId
int Int32 Int32 Int32

The ID of the original window before projection.

Returns

The asynchronous results of the operation. Use this to determine when the async call is complete.

Remarks

If this method succeeds, an existing window (app view) is placed on a secondary display, if one is detected. Otherwise, the window is placed on the primary display. This window can only be accessed from an ASTA UI thread.

The moved window has its own ASTA UI thread and associated CoreWindow. Always use thread-safe methods, such as window.postMessage for JavaScript apps or the CoreDispatcher event messaging API for C# and C++ apps, when communicating between the windows.

Either the current app view window or the projection view window must be active for this call to succeed. The view ID can be obtained for the current app view with ApplicationView.Id. For a specific app view managed by the app, call ApplicationView.GetApplicationViewIdForWindow with the CoreWindow for the app view.

See Also

StartProjectingAsync(Int32, Int32, DeviceInformation) StartProjectingAsync(Int32, Int32, DeviceInformation) StartProjectingAsync(Int32, Int32, DeviceInformation) StartProjectingAsync(Int32, Int32, DeviceInformation)

Asynchronously sends a window (app view) to the projector or other secondary display, and provides info about the display.

public : static IAsyncAction StartProjectingAsync(int projectionViewId, int anchorViewId, DeviceInformation displayDeviceInfo)
public static IAsyncAction StartProjectingAsync(Int32 projectionViewId, Int32 anchorViewId, DeviceInformation displayDeviceInfo)
Public Static Function StartProjectingAsync(projectionViewId As Int32, anchorViewId As Int32, displayDeviceInfo As DeviceInformation) As IAsyncAction
Windows.UI.ViewManagement.ProjectionManager.startProjectingAsync(projectionViewId, anchorViewId, displayDeviceInfo).done( /* Your success and error handlers */ );
Parameters
projectionViewId
int Int32 Int32 Int32

The new ID of the window to be displayed by the projector or other secondary display.

anchorViewId
int Int32 Int32 Int32

The ID of the original window before projection.

displayDeviceInfo
DeviceInformation DeviceInformation DeviceInformation DeviceInformation

Information about the display device.

Returns

The asynchronous results of the operation. Use this to determine when the async call is complete.

Remarks

If this method succeeds, an existing window (app view) is placed on a secondary display, if one is detected. Otherwise, the window is placed on the primary display. This window can only be accessed from an ASTA UI thread.

The moved window has its own ASTA UI thread and associated CoreWindow. Always use thread-safe methods, such as window.postMessage for JavaScript apps or the CoreDispatcher event messaging API for C# and C++ apps, when communicating between the windows.

Either the current app view window or the projection view window must be active for this call to succeed. The view ID can be obtained for the current app view with ApplicationView.Id. For a specific app view managed by the app, call ApplicationView.GetApplicationViewIdForWindow with the CoreWindow for the app view.

See Also

StopProjectingAsync(Int32, Int32) StopProjectingAsync(Int32, Int32) StopProjectingAsync(Int32, Int32) StopProjectingAsync(Int32, Int32)

Asynchronously hides a window (app view) displayed by a projector or other secondary display.

public : static IAsyncAction StopProjectingAsync(int projectionViewId, int anchorViewId)
public static IAsyncAction StopProjectingAsync(Int32 projectionViewId, Int32 anchorViewId)
Public Static Function StopProjectingAsync(projectionViewId As Int32, anchorViewId As Int32) As IAsyncAction
Windows.UI.ViewManagement.ProjectionManager.stopProjectingAsync(projectionViewId, anchorViewId).done( /* Your success and error handlers */ );
Parameters
projectionViewId
int Int32 Int32 Int32

The ID of the window currently displayed by the projector or other secondary display.

anchorViewId
int Int32 Int32 Int32

The ID of the original window before projection.

Returns

The asynchronous results of the operation. Use this to determine when the async call is complete.

SwapDisplaysForViewsAsync(Int32, Int32) SwapDisplaysForViewsAsync(Int32, Int32) SwapDisplaysForViewsAsync(Int32, Int32) SwapDisplaysForViewsAsync(Int32, Int32)

Asynchronously swaps the calling window (app view) with the window displayed on the projector or other secondary display. The result is that the calling window is displayed on the projector, and the formerly projected window is displayed on the device screen.

public : static IAsyncAction SwapDisplaysForViewsAsync(int projectionViewId, int anchorViewId)
public static IAsyncAction SwapDisplaysForViewsAsync(Int32 projectionViewId, Int32 anchorViewId)
Public Static Function SwapDisplaysForViewsAsync(projectionViewId As Int32, anchorViewId As Int32) As IAsyncAction
Windows.UI.ViewManagement.ProjectionManager.swapDisplaysForViewsAsync(projectionViewId, anchorViewId).done( /* Your success and error handlers */ );
Parameters
projectionViewId
int Int32 Int32 Int32

The ID of the window currently displayed by the projector.

anchorViewId
int Int32 Int32 Int32

The ID of the window to swap with the projected window.

Returns

The asynchronous results of the operation. Use this to determine when the async call is complete.

Events

ProjectionDisplayAvailableChanged ProjectionDisplayAvailableChanged ProjectionDisplayAvailableChanged ProjectionDisplayAvailableChanged

Occurs when a projector or other secondary display becomes available or unavailable.

public : event EventHandler ProjectionDisplayAvailableChanged<Platform::Object>
public event EventHandler ProjectionDisplayAvailableChanged<object>
Public Event EventHandler ProjectionDisplayAvailableChanged( Of ( Of object ))
function onProjectionDisplayAvailableChanged(eventArgs){/* Your code */}


projectionManager.addEventListener("projectionDisplayAvailableChanged", onProjectionDisplayAvailableChanged);
projectionManager.removeEventListener("projectionDisplayAvailableChanged", onProjectionDisplayAvailableChanged);

See Also