NotesWindowManagerPreview NotesWindowManagerPreview NotesWindowManagerPreview NotesWindowManagerPreview Class

Definition

This class owns much of the functionality of the Preview Notes application feature (see Remarks).

public : sealed class NotesWindowManagerPreview : INotesWindowManagerPreview, INotesWindowManagerPreview2public sealed class NotesWindowManagerPreview : INotesWindowManagerPreview, INotesWindowManagerPreview2Public NotInheritable Class NotesWindowManagerPreview Implements INotesWindowManagerPreview, INotesWindowManagerPreview2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.14393.0)
API contract
Windows.ApplicationModel.Preview.Notes.PreviewNotesContract (introduced v1)

Remarks

The Preview Notes feature allows a Universal Windows app to utilize the Windows Ink Workspace in order to provide a tailored note-taking experience on desktop devices. Apps that are recognized as such will operate with a number of behavioral changes meant to make the note-taking process faster and more convenient. For example, note-taking apps will open without a splash screen, will appear in the "Sticky Notes" section of the Windows Ink Workspace, will have their own configurable view-switching mechanism, and can display notes on a locked screen.

Properties

IsScreenLocked IsScreenLocked IsScreenLocked IsScreenLocked

Gets a value indicating whether the device's screen is currently locked.

public : PlatForm::Boolean IsScreenLocked { get; }public bool IsScreenLocked { get; }Public ReadOnly Property IsScreenLocked As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

true if screen is locked, false if unlocked.

Methods

GetForCurrentApp() GetForCurrentApp() GetForCurrentApp() GetForCurrentApp()

Returns an instance of NotesWindowManagerPreview, to be used for the majority of Preview Notes operations that an app may execute.

public : static NotesWindowManagerPreview GetForCurrentApp()public static NotesWindowManagerPreview GetForCurrentApp()Public Static Function GetForCurrentApp() As NotesWindowManagerPreview// You can use this method in JavaScript.
Returns

GetNotePlacement(Int32) GetNotePlacement(Int32) GetNotePlacement(Int32) GetNotePlacement(Int32)

Gets the view placement of a given note, to be stored in program memory or on disk storage and then restored by the application at a later time.

public : IBuffer GetNotePlacement(int noteViewId)public IBuffer GetNotePlacement(Int32 noteViewId)Public Function GetNotePlacement(noteViewId As Int32) As IBuffer// You can use this method in JavaScript.
Parameters
noteViewId
int Int32 Int32 Int32

The unique identifier of the note whose placement is to be retrieved.

Returns

An array of bytes holding note placement data.

Remarks

GetNotePlacement and ShowNoteWithPlacement can be used together to store the placement of a note (say, while the application is exiting) and then restore the note to its previous placement on the screen (when the application is opened again).

HideNote(Int32) HideNote(Int32) HideNote(Int32) HideNote(Int32)

Sets a note's view to invisible and moves the focus to the next visible note view (window) or to the Windows Ink Workspace (see Remarks). The views are selected in a cyclic, system-determined order.

Note

Even though the note disappears from the screen, its CoreWindow object remains until the NoteVisibilityChanged event is raised and the handling method closes the note's window by calling the Close method.

public : void HideNote(int noteViewId)public void HideNote(Int32 noteViewId)Public Function HideNote(noteViewId As Int32) As void// You can use this method in JavaScript.
Parameters
noteViewId
int Int32 Int32 Int32

The unique identifier of the note to be hidden.

Remarks

When the notes app is loaded from the Windows Ink Workspace, this method will switch focus to the Windows Ink Workspace if it is next in the order.

SetFocusToNextView() SetFocusToNextView() SetFocusToNextView() SetFocusToNextView()

Switches focus to the next visible note view (window) or to the Windows Ink Workspace (see Remarks). The views are selected in a cyclic, system-determined order.

public : void SetFocusToNextView()public void SetFocusToNextView()Public Function SetFocusToNextView() As void// You can use this method in JavaScript.

Remarks

When the notes app is loaded from the Windows Ink Workspace, this method also switches focus to the Windows Ink Workspace and then back to views within the notes app.

SetFocusToPreviousView() SetFocusToPreviousView() SetFocusToPreviousView() SetFocusToPreviousView()

Switches focus to the previous visible note view (window) or to the Windows Ink Workspace (see Remarks). The views are selected in a cyclic, system-determined order.

public : void SetFocusToPreviousView()public void SetFocusToPreviousView()Public Function SetFocusToPreviousView() As void// You can use this method in JavaScript.
Additional features and requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.15063.0)
API contract
Windows.ApplicationModel.Preview.Notes.PreviewNotesContract (introduced v2)

Remarks

When the notes app is loaded from the Windows Ink Workspace, this method also switches focus to the Windows Ink Workspace and then back to views within the notes app.

SetNotesThumbnailAsync(IBuffer) SetNotesThumbnailAsync(IBuffer) SetNotesThumbnailAsync(IBuffer) SetNotesThumbnailAsync(IBuffer)

Sets the thumbnail image for this application as it appears in the Windows Ink Workspace, in the Alt+TAB task switcher, or on hovering in the taskbar.

public : IAsyncAction SetNotesThumbnailAsync(IBuffer thumbnail)public IAsyncAction SetNotesThumbnailAsync(IBuffer thumbnail)Public Function SetNotesThumbnailAsync(thumbnail As IBuffer) As IAsyncAction// You can use this method in JavaScript.
Parameters
thumbnail
IBuffer IBuffer IBuffer IBuffer

A byte array describing the thumbnail image and usage (see Remarks).

Returns

This method does not return a value.

Remarks

The thumbnail byte array must adhere to the following format in order to describe a thumbnail image: Bytes 0-3: thumbnail type – a string value of either "NTPW" (for Ink Workspace appearance) or "NTTS" (for Alt+TAB switching and taskbar hover).

Bytes 4-7: Image width in pixels – an integer value.

Bytes 8-11: Image height in pixels – an integer value.

The final section must contain 4 * image width * image height number of bytes. Every 4-byte integer of this section corresponds to the BGRA color data of one pixel.

Note

If the size of the image used (in pixels) exceeds the size of the primary monitor, an InvalidArgumentException will be thrown.

SetThumbnailImageForTaskSwitcherAsync(SoftwareBitmap) SetThumbnailImageForTaskSwitcherAsync(SoftwareBitmap) SetThumbnailImageForTaskSwitcherAsync(SoftwareBitmap) SetThumbnailImageForTaskSwitcherAsync(SoftwareBitmap)

Asynchronously sets the thumbnail image for this application as it appears in the Alt+TAB task switcher.

public : IAsyncAction SetThumbnailImageForTaskSwitcherAsync(SoftwareBitmap bitmap)public IAsyncAction SetThumbnailImageForTaskSwitcherAsync(SoftwareBitmap bitmap)Public Function SetThumbnailImageForTaskSwitcherAsync(bitmap As SoftwareBitmap) As IAsyncAction// You can use this method in JavaScript.
Parameters
bitmap
SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap

A bitmap of the thumbnail image.

Returns

Returns an IAsyncAction that indicates when the action has completed.

Additional features and requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.15063.0)
API contract
Windows.ApplicationModel.Preview.Notes.PreviewNotesContract (introduced v2)
See Also

ShowNote(Int32) ShowNote(Int32) ShowNote(Int32) ShowNote(Int32)

Makes a note visible on the device screen.

Note

This method should only be called on a note that has been hidden with HideNote.

public : void ShowNote(int noteViewId)public void ShowNote(Int32 noteViewId)Public Function ShowNote(noteViewId As Int32) As void// You can use this method in JavaScript.
Parameters
noteViewId
int Int32 Int32 Int32

The unique identifier of the note to be shown.

ShowNoteRelativeTo(Int32, Int32) ShowNoteRelativeTo(Int32, Int32) ShowNoteRelativeTo(Int32, Int32) ShowNoteRelativeTo(Int32, Int32)

Makes a note visible and places it adjacent to a specified "anchor" view.

public : void ShowNoteRelativeTo(int noteViewId, int anchorNoteViewId)public void ShowNoteRelativeTo(Int32 noteViewId, Int32 anchorNoteViewId)Public Function ShowNoteRelativeTo(noteViewId As Int32, anchorNoteViewId As Int32) As void// You can use this method in JavaScript.
Parameters
noteViewId
int Int32 Int32 Int32

The unique identifier of the note to be shown.

anchorNoteViewId
int Int32 Int32 Int32

The Id of the "anchor" view. If this value is 0 (not assigned to any view), the note will appear at the center of the screen.

ShowNoteRelativeTo(Int32, Int32, NotesWindowManagerPreviewShowNoteOptions) ShowNoteRelativeTo(Int32, Int32, NotesWindowManagerPreviewShowNoteOptions) ShowNoteRelativeTo(Int32, Int32, NotesWindowManagerPreviewShowNoteOptions) ShowNoteRelativeTo(Int32, Int32, NotesWindowManagerPreviewShowNoteOptions)

Makes a note visible and places it adjacent to a specified "anchor" view.

public : void ShowNoteRelativeTo(int noteViewId, int anchorNoteViewId, NotesWindowManagerPreviewShowNoteOptions options)public void ShowNoteRelativeTo(Int32 noteViewId, Int32 anchorNoteViewId, NotesWindowManagerPreviewShowNoteOptions options)Public Function ShowNoteRelativeTo(noteViewId As Int32, anchorNoteViewId As Int32, options As NotesWindowManagerPreviewShowNoteOptions) As void// You can use this method in JavaScript.
Parameters
noteViewId
int Int32 Int32 Int32

The unique identifier of the note to be shown.

anchorNoteViewId
int Int32 Int32 Int32

The Id of the "anchor" view. If this value is 0 (not assigned to any view), the note will appear at the center of the screen.

options
NotesWindowManagerPreviewShowNoteOptions NotesWindowManagerPreviewShowNoteOptions NotesWindowManagerPreviewShowNoteOptions NotesWindowManagerPreviewShowNoteOptions

Options for showing the note specified by the noteViewId parameter. For example, show the note with focus.

Additional features and requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.15063.0)
API contract
Windows.ApplicationModel.Preview.Notes.PreviewNotesContract (introduced v2)
See Also

ShowNoteWithPlacement(Int32, IBuffer) ShowNoteWithPlacement(Int32, IBuffer) ShowNoteWithPlacement(Int32, IBuffer) ShowNoteWithPlacement(Int32, IBuffer)

Makes a note visible and sets its placement data (dimensions and location) as specified.

public : void ShowNoteWithPlacement(int noteViewId, IBuffer data)public void ShowNoteWithPlacement(Int32 noteViewId, IBuffer data)Public Function ShowNoteWithPlacement(noteViewId As Int32, data As IBuffer) As void// You can use this method in JavaScript.
Parameters
noteViewId
int Int32 Int32 Int32

The unique identifier of the note to be shown.

data
IBuffer IBuffer IBuffer IBuffer

An array of bytes holding note placement data.

Remarks

GetNotePlacement and ShowNoteWithPlacement can be used together to store the placement of a note (say, while the application is exiting) and then restore the note to its previous placement on the screen (when the application is opened again).

ShowNoteWithPlacement(Int32, IBuffer, NotesWindowManagerPreviewShowNoteOptions) ShowNoteWithPlacement(Int32, IBuffer, NotesWindowManagerPreviewShowNoteOptions) ShowNoteWithPlacement(Int32, IBuffer, NotesWindowManagerPreviewShowNoteOptions) ShowNoteWithPlacement(Int32, IBuffer, NotesWindowManagerPreviewShowNoteOptions)

Makes a note visible and sets its placement data (dimensions and location) as specified.

public : void ShowNoteWithPlacement(int noteViewId, IBuffer data, NotesWindowManagerPreviewShowNoteOptions options)public void ShowNoteWithPlacement(Int32 noteViewId, IBuffer data, NotesWindowManagerPreviewShowNoteOptions options)Public Function ShowNoteWithPlacement(noteViewId As Int32, data As IBuffer, options As NotesWindowManagerPreviewShowNoteOptions) As void// You can use this method in JavaScript.
Parameters
noteViewId
int Int32 Int32 Int32

The unique identifier of the note to be shown.

data
IBuffer IBuffer IBuffer IBuffer

An array of bytes holding note placement data.

options
NotesWindowManagerPreviewShowNoteOptions NotesWindowManagerPreviewShowNoteOptions NotesWindowManagerPreviewShowNoteOptions NotesWindowManagerPreviewShowNoteOptions

Options for showing the note specified by the noteViewId parameter. For example, show the note with focus.

Additional features and requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.15063.0)
API contract
Windows.ApplicationModel.Preview.Notes.PreviewNotesContract (introduced v2)

Remarks

GetNotePlacement and ShowNoteWithPlacement can be used together to store the placement of a note (say, while the application is exiting) and then restore the note to its previous placement on the screen (when the application is opened again).

See Also

TrySetNoteSize(Int32, Size) TrySetNoteSize(Int32, Size) TrySetNoteSize(Int32, Size) TrySetNoteSize(Int32, Size)

Resizes the specified note to the desired dimensions. If the given size is not recommended due to screen size/space issues, the note's size will not be changed.

public : PlatForm::Boolean TrySetNoteSize(int noteViewId, Size size)public bool TrySetNoteSize(Int32 noteViewId, Size size)Public Function TrySetNoteSize(noteViewId As Int32, size As Size) As bool// You can use this method in JavaScript.
Parameters
noteViewId
int Int32 Int32 Int32

The unique identifier of the note to be resized.

size
Size Size Size Size

The desired dimensions of the note (use raw pixels when constructing).

Returns
PlatForm::Boolean bool bool bool

true if the note was resized, false if it was not resized due to screen restrictions.

Events

NotePlacementChanged NotePlacementChanged NotePlacementChanged NotePlacementChanged

Indicates that a note's placement (dimensions and location) has changed.

Note

When this event is raised, the application should call GetNotePlacement to update its record with the note's new placement.

public : event TypedEventHandler NotePlacementChanged<NotesWindowManagerPreview,  NotePlacementChangedPreviewEventArgs>public event TypedEventHandler NotePlacementChanged<NotesWindowManagerPreview,  NotePlacementChangedPreviewEventArgs>Public Event NotePlacementChanged<NotesWindowManagerPreview,  NotePlacementChangedPreviewEventArgs>// You can use this event in JavaScript.

NoteVisibilityChanged NoteVisibilityChanged NoteVisibilityChanged NoteVisibilityChanged

Indicates that a note's visibility state has changed.

Note

When this event is raised, its handler must determine whether the given view was hidden or shown (according to the isVisible property in NoteVisibilityChangedPreviewEventArgs class). If hidden, the note's CoreWindow object must be closed (with the Close method) within the event handler.

public : event TypedEventHandler NoteVisibilityChanged<NotesWindowManagerPreview,  NoteVisibilityChangedPreviewEventArgs>public event TypedEventHandler NoteVisibilityChanged<NotesWindowManagerPreview,  NoteVisibilityChangedPreviewEventArgs>Public Event NoteVisibilityChanged<NotesWindowManagerPreview,  NoteVisibilityChangedPreviewEventArgs>// You can use this event in JavaScript.

SystemLockStateChanged SystemLockStateChanged SystemLockStateChanged SystemLockStateChanged

Indicates that the device's screen lock state has changed.

public : event TypedEventHandler SystemLockStateChanged<NotesWindowManagerPreview,  object>public event TypedEventHandler SystemLockStateChanged<NotesWindowManagerPreview,  object>Public Event SystemLockStateChanged<NotesWindowManagerPreview,  object>// You can use this event in JavaScript.