In my question in my opinion contain two separate.
The first is how to display an item only if there is a selected item. This problem can be solved by using a trigger to check that SelectedIndex ! = -1 . The simplest example is:
<Grid HorizontalAlignment="Center"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <ComboBox Name="some" Grid.Row="0" Margin="10" MinWidth="120" ItemsSource="{Binding Data}" /> <TextBlock Grid.Row="1" Text="{Binding Path=SelectedItem, ElementName=some}" Margin="10"> <TextBlock.Style> <Style> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=some, Path=SelectedIndex}" Value="-1"> <Setter Property="TextBlock.Visibility" Value="Collapsed" /> </DataTrigger> </Style.Triggers> </Style> </TextBlock.Style> </TextBlock> </Grid>
For completeness, I give a trivial context for the data.
module Context2 = open Gjallarhorn.Bindable let create() = let source = Binding.createSource() [|"Some1"; "Some2" ; "Some3" |] |> Binding.constantToView "Data" <| source source
The second - as depending on the selected item in the list to display the relevant data. In short - you create a list of "paged" VMs and link it to your ComboBox . You can directly display the selected item in ContentControl through a binding to SelectedItem or get a property in the main VM which will be responsible for the selected VM .
There is a great article Navigation with MVVM on this subject, where you can read about this approach in more detail, and also look at the implementation of a simple example.
Visibilitymust have the appropriate valuesVisible,HiddenorCollapsed( msdn ). You are not clear what they bind at all ... - MihailPw