public interface IRunicSidePanel : IAsyncDisposable A Window's side panel, which IRunicWindowPresentation.OpenSidePanelAsync opened: a page of the Window beside its page, on one edge by which the Window grew.
Remarks
The Window's page keeps its size and its place on the screen while the panel opens, closes, moves to the other edge or changes its width. The panel's page is a second connection of the Window and shares its ViewModel tree, so the ViewModel that opened the panel also serves it.
Disposing it closes it.
Properties
Edge
RunicSidePanelEdge Edge { get; } Gets the edge the panel is on: RunicSidePanelEdge.Left or RunicSidePanelEdge.Right.
IsOpen
bool IsOpen { get; } Gets whether the panel is open: false once it closed, for whatever reason.
Methods
CloseAsync
ValueTask CloseAsync(CancellationToken cancellationToken = default) Closes the panel: its page disconnects and the Window shrinks back. Closing a closed panel does nothing.
Parameters
cancellationTokenCancels waiting for the Window; the close itself proceeds.
Returns
A task that completes when the panel has closed.
FocusAsync
ValueTask FocusAsync(CancellationToken cancellationToken = default) Moves the keyboard focus into the panel's page; does nothing once the panel closed.
Parameters
cancellationTokenCancels waiting for the Window.
Returns
A task that completes when the panel has the focus.
MoveToEdgeAsync
ValueTask<RunicSidePanelRefusal?> MoveToEdgeAsync(RunicSidePanelEdge edge, CancellationToken cancellationToken = default) Moves the panel to another edge: the Window moves by the panel's width, and its page stays where it is.
Parameters
edgeThe new edge;
RunicSidePanelEdge.StartandRunicSidePanelEdge.Endfollow the Window's layout direction.cancellationTokenCancels waiting for the Window.
Returns
null when the panel is on that edge now, also when it already was; otherwise why it stayed: the Window's state, room, position (RunicSidePanelRefusal.PositionUnavailable) or RunicSidePanelRefusal.Closed once the panel closed.
Exceptions
ArgumentOutOfRangeExceptionedgeis not a defined value.
SetWidthAsync
ValueTask<RunicSidePanelRefusal?> SetWidthAsync(int width, CancellationToken cancellationToken = default) Changes the panel's width: the Window grows or shrinks on the panel's edge by the difference.
Parameters
widthThe new width, at least
RunicSidePanelOptions.MinimumWidth.cancellationTokenCancels waiting for the Window.
Returns
null when the panel has the width now; otherwise why it kept its width, as for IRunicSidePanel.MoveToEdgeAsync.
Exceptions
ArgumentOutOfRangeExceptionwidthis smaller thanRunicSidePanelOptions.MinimumWidth.
Events
Closed
event EventHandler<RunicSidePanelClosedEventArgs>? Closed Occurs once after the panel has closed, whatever closed it, in a turn of the Window's model context.
Remarks
IRunicWindowPresentation.SidePanel is null by then. A handler added after the panel closed is not called; check IRunicSidePanel.IsOpen after adding one.