ExecutionControl

July 30, 2026 · View on GitHub

A transport style control that exposes Play, Pause and Stop buttons suitable for a tool bar. Each button binds to its own command and is automatically disabled — and visually muted with the theme's disabled brush — when that command reports it cannot execute.

<ToolBar>
    <mosaic:ExecutionControl
        PlayCommand="{Binding PlayCommand}"
        PauseCommand="{Binding PauseCommand}"
        StopCommand="{Binding StopCommand}" />
</ToolBar>
PropertyDescription
PlayCommand, PauseCommand, StopCommandThe command invoked by each button. CanExecute drives the button's enabled/muted state.
PlayCommandParameter, PauseCommandParameter, StopCommandParameterOptional parameter passed to the matching command.
ShowPlayButton, ShowPauseButton, ShowStopButtonCollapses an individual button when set to False.
PlayToolTip, PauseToolTip, StopToolTipTool tip content for each button (shown even while disabled).
PlayBrush, PauseBrush, StopBrushIcon brushes; default to the theme's success, control foreground and error brushes.
DisabledBrushIcon brush used when a command cannot execute; defaults to the theme's disabled foreground brush.
IconSizeRendered width and height of each icon (default 16).
ButtonPaddingPadding around each icon.
OrientationLays the buttons out horizontally (default) or vertically.

The PlayClick, PauseClick and StopClick routed events are raised alongside the commands for code-behind scenarios.