The tree items bind to a property 'GotValue' and if the snapshot has a value for that item, it will be bold. The problem is that I need to somehow tell GotValue which snapshot to use, SlotA or SlotB. Here's the XAML for the left combobox and treeview, the other side is pretty much identical...
Code: Select all
<ComboBox ItemsSource="{Binding Slots, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding SelA, Mode=TwoWay}">
<ComboBox.Style>
<Style TargetType="{x:Type ComboBox}">
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding SlotA.HasData, UpdateSourceTrigger=PropertyChanged}" Value="True">
<Setter Property="FontWeight" Value="Bold"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ComboBox.Style>
<!-- removed stuff for item content -->
</ComboBox>
<TreeView x:Name="ListA" ItemsSource="{Binding States, UpdateSourceTrigger=PropertyChanged}">
<TreeView.ItemContainerStyle>
<!-- This Style binds a TreeViewItem to a TreeViewItemViewModel. -->
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="{Binding IsExpandedM, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelectedM, Mode=TwoWay}" />
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<!-- How can I select sanpshot A or B here? -->
<DataTrigger Binding="{Binding GotValue, UpdateSourceTrigger=PropertyChanged}" Value="True">
<Setter Property="FontWeight" Value="Bold"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TreeView.ItemContainerStyle>
<!-- removed stuff for tree stucture -->
</TreeView>