I managed to figure it out based upon another post. I used a ListBox like this;
<ListBox Style="{StaticResource SidebarListBoxStyle}"
ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Items}"
SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedPage}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Visibility">
<Setter.Value>
<MultiBinding Converter="{x:Static local:CustomValueConverter.Instance}">
<Binding />
<Binding Path="Wizard.SelectedPage" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
And a converter like this;
public class CustomValueConverter : IMultiValueConverter
{
public readonly static CustomValueConverter Instance = new CustomValueConverter();
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values == null || values.Length < 1)
throw new ArgumentException("values");
WizardPage page = values[0] as WizardPage;
if (page != null && page.Wizard != null)
{
int index = page.Wizard.Items.IndexOf(page);
if (index == 0) return (Visibility.Collapsed);
if (index + 1 == page.Wizard.Items.Count) return (Visibility.Collapsed);
}
return Visibility.Visible;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}