I have a ListBox displaying a menu, where the user can navigate in the application. Selecting a ListBox element will display the corresponding UserControl to the right of the menu. However, one of the menu items (ABOUT) should not be focusable, but only carry out a task (open a popup window). The selected item should remain what it was earlier.
Following suggestions in this link I've tried binding the Focusable property of the relevant ListBox element to a boolean property in the VM. But then I don't get any updates on the SelectedIndex property.
Is there any way around this?
XAML:
<ListBox Grid.Row="0"
ItemsSource="{Binding MenuButtonInfoList}"
SelectedIndex="{Binding SelectedMainMenuIndex, Mode=TwoWay}"
Background="Transparent" BorderBrush="Transparent" Padding="0"
VerticalContentAlignment="Center">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Focusable" Value="{Binding Path=Focusable}" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Border Style="{StaticResource MenuButtonBorder}">
<StackPanel Orientation="Horizontal" Height="Auto">
<Image Source="{Binding ImageFilePath}"
Style="{StaticResource MenuButtonImage}" />
<Label Content="{Binding Label}"
Style="{StaticResource MenuButtonLabel}" />
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>