|
2 | 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 4 | xmlns:util="clr-namespace:ZSpitz.Util.Wpf;assembly=ZSpitz.Util.Wpf" |
| 5 | + xmlns:nt="clr-namespace:NodaTime;assembly=NodaTime" |
| 6 | + xmlns:my="clr-namespace:DateTimeVisualizer" |
5 | 7 | Orientation="Vertical" RowCount="3"> |
| 8 | + <util:AutoGrid.Resources> |
| 9 | + <my:FilterStateConverter x:Key="FilterStateConverter" /> |
| 10 | + </util:AutoGrid.Resources> |
6 | 11 |
|
7 | 12 | <TextBlock Text="TZDB zones:" Margin="0,0,12,3" /> |
8 | | - <ListBox SelectionMode="Multiple" MaxHeight="300" SelectedValuePath="Model" ItemsSource="{Binding Tzdb.AvailableZones}" Margin="0,0,12,3"> |
9 | | - <ListBox.ItemContainerStyle> |
10 | | - <Style TargetType="ListBoxItem"> |
11 | | - <Setter Property="IsSelected" Value="{Binding IsSelected}" /> |
| 13 | + <TreeView MaxHeight="300" ItemsSource="{Binding AvailableTzdbZones}"> |
| 14 | + <TreeView.ItemContainerStyle> |
| 15 | + <Style TargetType="TreeViewItem"> |
| 16 | + <Setter Property="Visibility" Value="{Binding FilterState, Converter={StaticResource FilterStateConverter}}" /> |
12 | 17 | </Style> |
13 | | - </ListBox.ItemContainerStyle> |
14 | | - <ListBox.ItemTemplate> |
15 | | - <DataTemplate> |
16 | | - <TextBlock Text="{Binding Model}" /> |
17 | | - </DataTemplate> |
18 | | - </ListBox.ItemTemplate> |
19 | | - </ListBox> |
20 | | - <TextBlock Text="{Binding Tzdb.Model.VersionId}" /> |
| 18 | + </TreeView.ItemContainerStyle> |
| 19 | + <TreeView.ItemTemplate> |
| 20 | + <HierarchicalDataTemplate ItemsSource="{Binding Children}"> |
| 21 | + <StackPanel Orientation="Horizontal" Visibility="{Binding FilterState, Converter={StaticResource FilterStateConverter}}"> |
| 22 | + <CheckBox Margin="2" IsChecked="{Binding IsSelected}" /> |
| 23 | + <TextBlock Text="{Binding Text}" Foreground="{Binding FilterState, Converter={StaticResource FilterStateConverter}}" FontWeight="{Binding FilterState, Converter={StaticResource FilterStateConverter}}" /> |
| 24 | + </StackPanel> |
| 25 | + </HierarchicalDataTemplate> |
| 26 | + </TreeView.ItemTemplate> |
| 27 | + </TreeView> |
| 28 | + <TextBlock Text="{Binding VersionId, Source={x:Static nt:DateTimeZoneProviders.Tzdb}}" /> |
21 | 29 |
|
22 | 30 | <TextBlock Text="BCL zones:" Margin="0,0,0,3" /> |
23 | | - <ListBox SelectionMode="Multiple" MaxHeight="300" SelectedValuePath="Model" ItemsSource="{Binding Bcl.AvailableZones}" Margin="0,0,0,3"> |
| 31 | + <ListBox SelectionMode="Multiple" MaxHeight="300" SelectedValuePath="Text" ItemsSource="{Binding AvailableBclZones}" Margin="0,0,0,3"> |
24 | 32 | <ListBox.ItemContainerStyle> |
25 | 33 | <Style TargetType="ListBoxItem"> |
26 | 34 | <Setter Property="IsSelected" Value="{Binding IsSelected}" /> |
27 | 35 | </Style> |
28 | 36 | </ListBox.ItemContainerStyle> |
29 | 37 | <ListBox.ItemTemplate> |
30 | 38 | <DataTemplate> |
31 | | - <TextBlock Text="{Binding Model}" /> |
| 39 | + <TextBlock Text="{Binding Text}" /> |
32 | 40 | </DataTemplate> |
33 | 41 | </ListBox.ItemTemplate> |
34 | 42 | </ListBox> |
35 | | - <TextBlock Text="{Binding Bcl.Model.VersionId}" /> |
| 43 | + <TextBlock Text="{Binding VersionId, Source={x:Static nt:DateTimeZoneProviders.Bcl}}" /> |
36 | 44 |
|
37 | 45 | </util:AutoGrid> |
0 commit comments