Smart Navigator
A set of pages shown one at a time, with round previous and next buttons, a row of page dots and the current page's title – for a set-up wizard, a guided tour, a slide show or a step-by-step form.
Assembly
| Assembly | Binarymission.WPF.Controls.ListControls.BinarySmartNavigator.dll |
| Root namespace | Binarymission.WPF.Controls.ListControls |
| Target frameworks | .NET Framework 4.8, .NET 6 / 8 / 10 |
| Depends on | Skinning |
Overview
It is a TabControl with a different face. Each
BinarySmartNavigatorItem is one page: its HeaderedContentControl.Header
is the page's title and its ContentControl.Content is what the page shows. Instead of a
row of tabs, the control draws a title strip across the top holding the title of the page on show
and a small dot for every page, and a round button on each side that steps back and forward through
the pages.
Moving between pages
The user moves with the previous and next buttons, or by clicking a page's dot. The buttons
disable themselves at the first and last page, with a tooltip saying why, and the selection does
not wrap round. In code, set
SelectedIndex or
SelectedItem, and handle
SelectionChanged to follow the
user – checking that the event's OriginalSource is the navigator, as a list or combo box on a
page raises the same bubbling event. The keyboard works as in any tab control.
Layout and animation
NavigationOrientation puts the buttons at the left and right
(NavigationOrientationIs.Horizontal, the default) or at the top and bottom, pointing up
and down. ControlAnimationType chooses how a page arrives; by default it blinks out and
fades back in. Control.Padding is the space around each page's content, 12 by 8 logical
pixels by default.
Appearance
Every part has a brush of its own: the title strip (ItemTitleBackground,
ItemTitleForeground), the dots (ItemEllipse...), and the buttons at rest, under
the pointer, pressed and disabled (NavigationButton...), with an optional glow
(NavigationButtonHasDropShadow). The defaults given are the ones used with no
Binarymission skin in force; while a skin is applied through BinarySkinManager it supplies its
own, and a brush set on the control still wins.
Getting started
A four-page set-up wizard. The assembly is
Binarymission.WPF.Controls.ListControls.BinarySmartNavigator.
<Window x:Class="Accounts.SetupWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:nav="clr-namespace:Binarymission.WPF.Controls.ListControls;assembly=Binarymission.WPF.Controls.ListControls.BinarySmartNavigator"
Title="Set up your company" Width="600" Height="400">
<DockPanel Margin="12">
<Button x:Name="finishButton" DockPanel.Dock="Bottom" HorizontalAlignment="Right"
Content="Finish" IsEnabled="False" Margin="0,8,0,0" />
<nav:BinarySmartNavigator x:Name="setupPages"
ControlAnimationType="ContentVanishesAndAppears"
SelectionChanged="OnPageChanged">
<nav:BinarySmartNavigatorItem Header="Welcome">
<TextBlock TextWrapping="Wrap"
Text="This wizard creates your company file. It takes about five minutes." />
</nav:BinarySmartNavigatorItem>
<nav:BinarySmartNavigatorItem Header="Company details">
<StackPanel>
<TextBlock Text="Registered name" />
<TextBox Text="{Binding CompanyName}" />
<TextBlock Text="Company number" Margin="0,8,0,0" />
<TextBox Text="{Binding CompanyNumber}" />
</StackPanel>
</nav:BinarySmartNavigatorItem>
<nav:BinarySmartNavigatorItem Header="VAT">
<CheckBox Content="The company is registered for VAT" IsChecked="{Binding IsVatRegistered}" />
</nav:BinarySmartNavigatorItem>
<nav:BinarySmartNavigatorItem Header="Ready">
<TextBlock Text="Press Finish to create the company file." />
</nav:BinarySmartNavigatorItem>
</nav:BinarySmartNavigator>
</DockPanel>
</Window>private void OnPageChanged(object sender, SelectionChangedEventArgs e)
{
// A list or combo box on a page raises the same bubbling event.
if (e.OriginalSource != setupPages)
{
return;
}
finishButton.IsEnabled = setupPages.SelectedIndex == setupPages.Items.Count - 1;
}API reference
Binarymission.WPF.Controls.ListControls
class BinarySmartListBox | A strip of cards the user steps through one at a time with round previous and next buttons, the arrow keys or the mouse wheel - for recent documents, news items, products, or a gallery of reports. |
enum ControlItemAnimationType | The ways a BinarySmartListBox can animate its strip of cards when the selection moves. |
enum NavigationOrientationIs | Which way a BinarySmartListBox lays out its cards. |
class BinarySmartListBoxItem | A card in a BinarySmartListBox: a rounded box holding a picture, a bold title and a line or two of text - or any content of your own. |
class BinarySmartListResources | The resource keys of the BinarySmartListBoxItem card style and of the colours of the selected and disabled cards, for restyling the cards of a BinarySmartListBox from your own resources. |
class BinarySmartNavigator | A set of pages shown one at a time, with round previous and next buttons, a row of page dots and the current page's title - for a set-up wizard, a guided tour, a slide show or a step-by-step form. |
enum ControlItemAnimationType | The ways a BinarySmartNavigator can animate the arrival of a new page. |
enum NavigationOrientationIs | Where a BinarySmartNavigator puts its previous and next buttons. |
class BinarySmartNavigatorButton | The round previous and next button of a BinarySmartNavigator, coloured by the navigator's NavigationButton... brushes. |
class BinarySmartNavigatorItem | One page of a BinarySmartNavigator, drawn in the title strip as a small dot. |
class BinarySmartNavigatorListBoxButton | The round previous and next button of a BinarySmartListBox, coloured by the list's NavigationButton... brushes. |
class PathToImageSourceConverter | Turns an image path or URI in a binding into an ImageSource - for binding ItemImage, or any Image, to a string property. |
class SolidColorBrushToColorConverter | Gets the Color of a SolidColorBrush, for bindings that need a colour. |