HypernovaDesktop Components · docs
Binarymission
WPF › Ribbon › BinaryRibbonLivePreview

BinaryRibbonLivePreview

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.Office

The events a ribbon raises while offering a live preview, and the helpers for handling them.

public static class BinaryRibbonLivePreview

Remarks

Live preview is the ribbon's most recognisable behaviour: the pointer rests on a gallery item and the document shows what choosing it would do, moving away puts the document back, and clicking keeps the change. **The control cannot do any of that itself** - only the application knows what its document is and how to change it reversibly. So the ribbon says what the user is pointing at and when to stop, and the application does the rest. The three events bubble, so one handler on the ribbon, a tab or the window answers for every gallery beneath it. The order is always the same and is worth relying on: a PreviewRequestedEvent is followed by exactly one of PreviewCommittedEvent or PreviewCancelledEvent. Moving from one item straight to another raises a new request without a cancel in between, because the application is being told what to show, not asked to undo and redo.

Members at a glance

AddPreviewCancelledHandlerAdds a handler for PreviewCancelledEvent.
AddPreviewCommittedHandlerAdds a handler for PreviewCommittedEvent.
AddPreviewRequestedHandlerAdds a handler for PreviewRequestedEvent.
RemovePreviewCancelledHandlerRemoves a handler for PreviewCancelledEvent.
RemovePreviewCommittedHandlerRemoves a handler for PreviewCommittedEvent.
RemovePreviewRequestedHandlerRemoves a handler for PreviewRequestedEvent.
PreviewCancelledEventOccurs when the user has stopped pointing at anything, and the application should put the document back as it was.
PreviewCommittedEventOccurs when the user has chosen what they were pointing at, and the change should stay.
PreviewRequestedEventOccurs when the user is pointing at something, and the application should show what choosing it would do.

Methods

AddPreviewCancelledHandler

public static void AddPreviewCancelledHandler( DependencyObject element, EventHandler<BinaryRibbonLivePreviewEventArgs> handler)

Adds a handler for PreviewCancelledEvent.

element
The element to handle it on.
handler
The handler.

AddPreviewCommittedHandler

public static void AddPreviewCommittedHandler( DependencyObject element, EventHandler<BinaryRibbonLivePreviewEventArgs> handler)

Adds a handler for PreviewCommittedEvent.

element
The element to handle it on.
handler
The handler.

AddPreviewRequestedHandler

public static void AddPreviewRequestedHandler( DependencyObject element, EventHandler<BinaryRibbonLivePreviewEventArgs> handler)

Adds a handler for PreviewRequestedEvent.

element
The element to handle it on.
handler
The handler.

RemovePreviewCancelledHandler

public static void RemovePreviewCancelledHandler( DependencyObject element, EventHandler<BinaryRibbonLivePreviewEventArgs> handler)

Removes a handler for PreviewCancelledEvent.

element
The element the handler was added to.
handler
The handler.

RemovePreviewCommittedHandler

public static void RemovePreviewCommittedHandler( DependencyObject element, EventHandler<BinaryRibbonLivePreviewEventArgs> handler)

Removes a handler for PreviewCommittedEvent.

element
The element the handler was added to.
handler
The handler.

RemovePreviewRequestedHandler

public static void RemovePreviewRequestedHandler( DependencyObject element, EventHandler<BinaryRibbonLivePreviewEventArgs> handler)

Removes a handler for PreviewRequestedEvent.

element
The element the handler was added to.
handler
The handler.

Fields

PreviewCancelledEvent

public static readonly RoutedEvent PreviewCancelledEvent

Occurs when the user has stopped pointing at anything, and the application should put the document back as it was.

PreviewCommittedEvent

public static readonly RoutedEvent PreviewCommittedEvent

Occurs when the user has chosen what they were pointing at, and the change should stay.

PreviewRequestedEvent

public static readonly RoutedEvent PreviewRequestedEvent

Occurs when the user is pointing at something, and the application should show what choosing it would do.