|
8 | 8 | d:DesignHeight="300" Width="555"
|
9 | 9 | d:DataContext="{d:DesignInstance {x:Type assistant:RegexAssistantViewModel}, IsDesignTimeCreatable=False}">
|
10 | 10 | <UserControl.Resources>
|
| 11 | + <Style TargetType="{x:Type TreeViewItem}" x:Key="ShinyRegexTreeViewItem"> |
| 12 | + <Setter Property="Template"> |
| 13 | + <Setter.Value> |
| 14 | + <ControlTemplate TargetType="{x:Type TreeViewItem}"> |
| 15 | + <Grid> |
| 16 | + <Grid.ColumnDefinitions> |
| 17 | + <ColumnDefinition MinWidth="19" Width="Auto"/> |
| 18 | + <ColumnDefinition Width="Auto"/> |
| 19 | + </Grid.ColumnDefinitions> |
| 20 | + <Grid.RowDefinitions> |
| 21 | + <RowDefinition Height="Auto"/> |
| 22 | + <RowDefinition Height="Auto"/> |
| 23 | + </Grid.RowDefinitions> |
| 24 | + |
| 25 | + <ToggleButton x:Name="Expander" |
| 26 | + IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" |
| 27 | + ClickMode="Press"/> |
| 28 | + <Border Name="Bd" |
| 29 | + Grid.Column="1" |
| 30 | + Background="{TemplateBinding Background}" |
| 31 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 32 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 33 | + Padding="{TemplateBinding Padding}" |
| 34 | + SnapsToDevicePixels="True"> |
| 35 | + <ContentPresenter x:Name="PART_Header" |
| 36 | + ContentSource="Header" |
| 37 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 38 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> |
| 39 | + </Border> |
| 40 | + <Border x:Name="ItemsHostBd" Grid.Row="1" Grid.Column="1"> |
| 41 | + <ItemsPresenter x:Name="ItemsHost" /> |
| 42 | + </Border> |
| 43 | + </Grid> |
| 44 | + <ControlTemplate.Triggers> |
| 45 | + <Trigger Property="IsExpanded" Value="False"> |
| 46 | + <Setter TargetName="ItemsHostBd" Property="Visibility" Value="Collapsed"/> |
| 47 | + </Trigger> |
| 48 | + <Trigger Property="HasItems" Value="False"> |
| 49 | + <Setter TargetName="Expander" Property="Visibility" Value="Hidden"/> |
| 50 | + </Trigger> |
| 51 | + <Trigger Property="IsSelected" Value="True"> |
| 52 | + <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> |
| 53 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/> |
| 54 | + </Trigger> |
| 55 | + <MultiTrigger> |
| 56 | + <MultiTrigger.Conditions> |
| 57 | + <Condition Property="IsSelected" Value="True"/> |
| 58 | + <Condition Property="IsSelectionActive" Value="False"/> |
| 59 | + </MultiTrigger.Conditions> |
| 60 | + <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/> |
| 61 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> |
| 62 | + </MultiTrigger> |
| 63 | + <Trigger Property="IsEnabled" Value="False"> |
| 64 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> |
| 65 | + </Trigger> |
| 66 | + </ControlTemplate.Triggers> |
| 67 | + </ControlTemplate> |
| 68 | + </Setter.Value> |
| 69 | + </Setter> |
| 70 | + </Style> |
| 71 | + |
11 | 72 | <HierarchicalDataTemplate
|
12 |
| - x:Key="RecursiveData" DataType="TreeViewItem" ItemsSource="{Binding Items}"> |
| 73 | + x:Key="RecursiveData" DataType="TreeViewItem" |
| 74 | + ItemContainerStyle="{StaticResource ShinyRegexTreeViewItem}" |
| 75 | + ItemsSource="{Binding Items}"> |
13 | 76 | </HierarchicalDataTemplate>
|
14 | 77 | </UserControl.Resources>
|
15 |
| - <Grid> |
16 |
| - <ScrollViewer> |
17 |
| - <Grid> |
18 |
| - <StackPanel Grid.Row="0" Margin="5,5,5,5"> |
19 |
| - <Label DockPanel.Dock="Top" Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_Caption}" |
| 78 | + <Grid Margin="0,0,0,0"> |
| 79 | + <ScrollViewer VerticalContentAlignment="Stretch"> |
| 80 | + <StackPanel Margin="5,5,5,5"> |
| 81 | + <Label DockPanel.Dock="Top" Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_Caption}" |
20 | 82 | Background="DarkGray"
|
21 | 83 | Foreground="White"
|
22 | 84 | FontWeight="SemiBold"
|
23 | 85 | Margin="0,0,0,3">
|
24 |
| - <Label.Style> |
25 |
| - <Style> |
26 |
| - <Style.Resources> |
27 |
| - <Style TargetType="{x:Type Border}"> |
28 |
| - <Setter Property="CornerRadius" Value="5"/> |
29 |
| - </Style> |
30 |
| - </Style.Resources> |
31 |
| - </Style> |
32 |
| - </Label.Style> |
33 |
| - </Label> |
34 |
| - <Label Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_RegexPatternLabel}" |
| 86 | + <Label.Style> |
| 87 | + <Style> |
| 88 | + <Style.Resources> |
| 89 | + <Style TargetType="{x:Type Border}"> |
| 90 | + <Setter Property="CornerRadius" Value="5"/> |
| 91 | + </Style> |
| 92 | + </Style.Resources> |
| 93 | + </Style> |
| 94 | + </Label.Style> |
| 95 | + </Label> |
| 96 | + <Label Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_RegexPatternLabel}" |
35 | 97 | FontWeight="SemiBold" />
|
36 |
| - <TextBox HorizontalAlignment="Left" TextWrapping="Wrap" |
37 |
| - VerticalAlignment="Top" MinWidth="250" MinHeight="23" MaxHeight="23" |
38 |
| - VerticalContentAlignment="Center" Margin="15,5,5,5" Text="{Binding Pattern}"/> |
39 |
| - <StackPanel Orientation="Horizontal"> |
40 |
| - <CheckBox Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_GlobalFlag}" |
41 |
| - HorizontalAlignment="Left" Height="18" VerticalAlignment="Top" MinWidth="110" |
42 |
| - Margin="15,5,5,5" IsChecked="{Binding GlobalFlag}"/> |
43 |
| - <CheckBox Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_IgnoreCaseFlag}" |
44 |
| - HorizontalAlignment="Left" Height="18" VerticalAlignment="Top" MinWidth="110" |
45 |
| - Margin="15,5,5,5" IsChecked="{Binding IgnoreCaseFlag}"/> |
46 |
| - </StackPanel> |
47 |
| - <Label Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_DescriptionResultsLabel}" |
48 |
| - FontWeight="SemiBold" /> |
49 |
| - |
50 |
| - <TreeView x:Name="treeView" ItemTemplate="{StaticResource RecursiveData}" |
51 |
| - Height="145" VerticalAlignment="Stretch" Margin="15,10,10,10" HorizontalContentAlignment="Stretch" |
52 |
| - ItemsSource="{Binding ResultItems}" /> |
| 98 | + <TextBox HorizontalAlignment="Left" TextWrapping="Wrap" |
| 99 | + VerticalAlignment="Top" MinWidth="250" MinHeight="23" MaxHeight="23" |
| 100 | + VerticalContentAlignment="Center" Margin="15,5,5,5" Text="{Binding Pattern}"/> |
| 101 | + <StackPanel Orientation="Horizontal"> |
| 102 | + <CheckBox Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_GlobalFlag}" |
| 103 | + HorizontalAlignment="Left" Height="18" VerticalAlignment="Top" MinWidth="110" |
| 104 | + Margin="15,5,5,5" IsChecked="{Binding GlobalFlag}"/> |
| 105 | + <CheckBox Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_IgnoreCaseFlag}" |
| 106 | + HorizontalAlignment="Left" Height="18" VerticalAlignment="Top" MinWidth="110" |
| 107 | + Margin="15,5,5,5" IsChecked="{Binding IgnoreCaseFlag}"/> |
53 | 108 | </StackPanel>
|
54 |
| - </Grid> |
| 109 | + <Label Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=RegexAssistant_DescriptionResultsLabel}" |
| 110 | + FontWeight="SemiBold" /> |
| 111 | + |
| 112 | + <TreeView x:Name="treeView" ItemTemplate="{StaticResource RecursiveData}" ItemContainerStyle="{StaticResource ShinyRegexTreeViewItem}" |
| 113 | + VerticalAlignment="Stretch" Margin="15,10,10,10" HorizontalContentAlignment="Stretch" Height="Auto" |
| 114 | + ItemsSource="{Binding ResultItems}" DockPanel.Dock="Bottom" /> |
| 115 | + </StackPanel> |
55 | 116 | </ScrollViewer>
|
56 | 117 | </Grid>
|
57 | 118 | </UserControl>
|
0 commit comments