Our third mode of the week is called HeaderGroup and for the first time we have a mode that allows the user to navigate between pages.

NavigationMode = HeaderGroup

The appearance is what you would expect; it replicates the KryptonHeaderGroup appearance with top and bottom headers. Here is a picture of the mode without any KryptonPage instances added as pages.

You can customize the text and images that appear in the headers when it does not have any pages defined. The default is to display just (Empty) but you can use something more appropriate for your application or change it to an empty string.

Once a page has been added it will use the values from the page in order to populate the text and images in the headers. Here is the display when we have added some pages.

The Title 1 and Description 1 have been pulled in from the page details of the selected page. Another post will outline the exact mechanics for pulling in page details for the display, but it is very flexible in order to meet whatever your needs are.

Notice two buttons appear when there is at least one page. The right hand cross is the close button and the left hand the context button. If you press the close button it will do the expected, remove the page from the collection. Pressing the context button allows you to select from a context menu the page you would like to select. Here you can see it in action.

If you prefer a more sequential way of selecting pages then you can modify a property and use next/previous buttons. Here you can see that the previous button is disabled because we are already at first page. The next button is enabled because there is a page afterwards.

If you really want both methods of navigating, then you can…

Here is the navigator with the LightWeight custom palette being used.

Page selection uses the events outlined in a previous post. So when the user clicks the next/previous or an entry in the context menu it will generate the Deselecting and Selecting events to check the page change is allowed. Both of these events are cancellable so you can prevent page changes if required. If the transition is allowed then it generates Deselected, Selected and SelectedPageChanged events.

Leave a Reply