|
4 | 4 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 | 6 | xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0" |
| 7 | + xmlns:imaging="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.Imaging" |
| 8 | + xmlns:catalog="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.ImageCatalog" |
| 9 | + xmlns:theming="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging" |
7 | 10 | xmlns:vm="clr-namespace:CodingWithCalvin.CouchbaseExplorer.ViewModels" |
8 | 11 | Background="{DynamicResource {x:Static vsshell:VsBrushes.WindowKey}}" |
9 | 12 | Foreground="{DynamicResource {x:Static vsshell:VsBrushes.WindowTextKey}}" |
|
70 | 73 | <!-- Data Template for Connection Node --> |
71 | 74 | <HierarchicalDataTemplate DataType="{x:Type vm:ConnectionNode}" ItemsSource="{Binding Children}"> |
72 | 75 | <StackPanel Orientation="Horizontal"> |
73 | | - <TextBlock Text="⚡" Margin="0,0,5,0" Visibility="{Binding IsConnected, Converter={StaticResource BoolToVisibilityConverter}, FallbackValue=Collapsed}" /> |
74 | | - <TextBlock Text="○" Margin="0,0,5,0" Visibility="{Binding IsConnected, Converter={StaticResource InverseBoolToVisibilityConverter}, FallbackValue=Visible}" /> |
75 | | - <TextBlock Text="{Binding Name}" /> |
| 76 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 77 | + Moniker="{x:Static catalog:KnownMonikers.DatabaseRunning}" |
| 78 | + Visibility="{Binding IsConnected, Converter={StaticResource BoolToVisibilityConverter}, FallbackValue=Collapsed}" /> |
| 79 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 80 | + Moniker="{x:Static catalog:KnownMonikers.Disconnect}" |
| 81 | + Visibility="{Binding IsConnected, Converter={StaticResource InverseBoolToVisibilityConverter}, FallbackValue=Visible}" /> |
| 82 | + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" /> |
76 | 83 | </StackPanel> |
77 | 84 | </HierarchicalDataTemplate> |
78 | 85 |
|
79 | 86 | <!-- Data Template for Buckets Folder Node --> |
80 | 87 | <HierarchicalDataTemplate DataType="{x:Type vm:BucketsFolderNode}" ItemsSource="{Binding Children}"> |
81 | 88 | <StackPanel Orientation="Horizontal"> |
82 | | - <TextBlock Text="📁" Margin="0,0,5,0" /> |
83 | | - <TextBlock Text="{Binding Name}" /> |
| 89 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 90 | + Moniker="{x:Static catalog:KnownMonikers.FolderClosed}" /> |
| 91 | + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" /> |
84 | 92 | </StackPanel> |
85 | 93 | </HierarchicalDataTemplate> |
86 | 94 |
|
87 | 95 | <!-- Data Template for Indexes Folder Node --> |
88 | 96 | <HierarchicalDataTemplate DataType="{x:Type vm:IndexesFolderNode}" ItemsSource="{Binding Children}"> |
89 | 97 | <StackPanel Orientation="Horizontal"> |
90 | | - <TextBlock Text="📁" Margin="0,0,5,0" /> |
91 | | - <TextBlock Text="{Binding Name}" /> |
| 98 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 99 | + Moniker="{x:Static catalog:KnownMonikers.FolderClosed}" /> |
| 100 | + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" /> |
92 | 101 | </StackPanel> |
93 | 102 | </HierarchicalDataTemplate> |
94 | 103 |
|
95 | 104 | <!-- Data Template for Bucket Node --> |
96 | 105 | <HierarchicalDataTemplate DataType="{x:Type vm:BucketNode}" ItemsSource="{Binding Children}"> |
97 | 106 | <StackPanel Orientation="Horizontal"> |
98 | | - <TextBlock Text="🪣" Margin="0,0,5,0" /> |
99 | | - <TextBlock Text="{Binding Name}" /> |
| 107 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 108 | + Moniker="{x:Static catalog:KnownMonikers.Database}" /> |
| 109 | + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" /> |
100 | 110 | </StackPanel> |
101 | 111 | </HierarchicalDataTemplate> |
102 | 112 |
|
103 | 113 | <!-- Data Template for Scope Node --> |
104 | 114 | <HierarchicalDataTemplate DataType="{x:Type vm:ScopeNode}" ItemsSource="{Binding Children}"> |
105 | 115 | <StackPanel Orientation="Horizontal"> |
106 | | - <TextBlock Text="📂" Margin="0,0,5,0" /> |
107 | | - <TextBlock Text="{Binding Name}" /> |
| 116 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 117 | + Moniker="{x:Static catalog:KnownMonikers.Namespace}" /> |
| 118 | + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" /> |
108 | 119 | </StackPanel> |
109 | 120 | </HierarchicalDataTemplate> |
110 | 121 |
|
111 | 122 | <!-- Data Template for Collection Node --> |
112 | 123 | <HierarchicalDataTemplate DataType="{x:Type vm:CollectionNode}" ItemsSource="{Binding Children}"> |
113 | 124 | <StackPanel Orientation="Horizontal"> |
114 | | - <TextBlock Text="📄" Margin="0,0,5,0" /> |
115 | | - <TextBlock Text="{Binding Name}" /> |
| 125 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 126 | + Moniker="{x:Static catalog:KnownMonikers.Table}" /> |
| 127 | + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" /> |
116 | 128 | </StackPanel> |
117 | 129 | </HierarchicalDataTemplate> |
118 | 130 |
|
119 | 131 | <!-- Data Template for Document Node --> |
120 | 132 | <DataTemplate DataType="{x:Type vm:DocumentNode}"> |
121 | 133 | <StackPanel Orientation="Horizontal"> |
122 | | - <TextBlock Text="{}{ }" Margin="0,0,5,0" FontFamily="Consolas" /> |
123 | | - <TextBlock Text="{Binding Name}" /> |
| 134 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 135 | + Moniker="{x:Static catalog:KnownMonikers.Document}" /> |
| 136 | + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" /> |
124 | 137 | </StackPanel> |
125 | 138 | </DataTemplate> |
126 | 139 |
|
127 | 140 | <!-- Data Template for Index Node --> |
128 | 141 | <DataTemplate DataType="{x:Type vm:IndexNode}"> |
129 | 142 | <StackPanel Orientation="Horizontal"> |
130 | | - <TextBlock Text="⚡" Margin="0,0,5,0" /> |
131 | | - <TextBlock Text="{Binding Name}" /> |
| 143 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 144 | + Moniker="{x:Static catalog:KnownMonikers.SearchMember}" /> |
| 145 | + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" /> |
132 | 146 | </StackPanel> |
133 | 147 | </DataTemplate> |
134 | 148 |
|
135 | 149 | <!-- Data Template for Placeholder Node (Loading...) --> |
136 | 150 | <DataTemplate DataType="{x:Type vm:PlaceholderNode}"> |
137 | | - <TextBlock Text="{Binding Name}" FontStyle="Italic" |
138 | | - Foreground="{DynamicResource {x:Static vsshell:VsBrushes.GrayTextKey}}" /> |
| 151 | + <StackPanel Orientation="Horizontal"> |
| 152 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 153 | + Moniker="{x:Static catalog:KnownMonikers.StatusRunning}" /> |
| 154 | + <TextBlock Text="{Binding Name}" FontStyle="Italic" VerticalAlignment="Center" |
| 155 | + Foreground="{DynamicResource {x:Static vsshell:VsBrushes.GrayTextKey}}" /> |
| 156 | + </StackPanel> |
139 | 157 | </DataTemplate> |
140 | 158 |
|
141 | 159 | <!-- Data Template for Load More Node --> |
142 | 160 | <DataTemplate DataType="{x:Type vm:LoadMoreNode}"> |
143 | | - <TextBlock Text="{Binding Name}" FontStyle="Italic" TextDecorations="Underline" Cursor="Hand" |
144 | | - Foreground="{DynamicResource {x:Static vsshell:VsBrushes.HighlightKey}}" /> |
| 161 | + <StackPanel Orientation="Horizontal"> |
| 162 | + <imaging:CrispImage Width="16" Height="16" Margin="0,0,5,0" |
| 163 | + Moniker="{x:Static catalog:KnownMonikers.Download}" /> |
| 164 | + <TextBlock Text="{Binding Name}" FontStyle="Italic" TextDecorations="Underline" Cursor="Hand" |
| 165 | + VerticalAlignment="Center" |
| 166 | + Foreground="{DynamicResource {x:Static vsshell:VsBrushes.HighlightKey}}" /> |
| 167 | + </StackPanel> |
145 | 168 | </DataTemplate> |
146 | 169 |
|
147 | 170 | <!-- Bool to Visibility Converter --> |
|
161 | 184 | </Grid.RowDefinitions> |
162 | 185 |
|
163 | 186 | <!-- Toolbar --> |
164 | | - <ToolBar Grid.Row="0" |
165 | | - Background="{DynamicResource {x:Static vsshell:VsBrushes.CommandBarGradientKey}}"> |
166 | | - <Button Command="{Binding AddConnectionCommand}" ToolTip="Add Connection"> |
167 | | - <TextBlock Text="➕" /> |
168 | | - </Button> |
169 | | - <Button Command="{Binding RefreshCommand}" ToolTip="Refresh"> |
170 | | - <TextBlock Text="🔄" /> |
171 | | - </Button> |
172 | | - <Button Command="{Binding CollapseAllCommand}" ToolTip="Collapse All"> |
173 | | - <TextBlock Text="⊟" /> |
174 | | - </Button> |
175 | | - </ToolBar> |
| 187 | + <Border Grid.Row="0" |
| 188 | + Background="{DynamicResource {x:Static vsshell:VsBrushes.ToolWindowBackgroundKey}}" |
| 189 | + BorderBrush="{DynamicResource {x:Static vsshell:VsBrushes.ToolWindowBorderKey}}" |
| 190 | + BorderThickness="0,0,0,1" |
| 191 | + Padding="2" |
| 192 | + theming:ImageThemingUtilities.ImageBackgroundColor="{DynamicResource {x:Static vsshell:VsColors.ToolWindowBackgroundKey}}"> |
| 193 | + <Border.Resources> |
| 194 | + <Style TargetType="Button"> |
| 195 | + <Setter Property="Background" Value="Transparent" /> |
| 196 | + <Setter Property="BorderThickness" Value="0" /> |
| 197 | + <Setter Property="Padding" Value="4" /> |
| 198 | + <Setter Property="Template"> |
| 199 | + <Setter.Value> |
| 200 | + <ControlTemplate TargetType="Button"> |
| 201 | + <Border Background="{TemplateBinding Background}" |
| 202 | + Padding="{TemplateBinding Padding}"> |
| 203 | + <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> |
| 204 | + </Border> |
| 205 | + <ControlTemplate.Triggers> |
| 206 | + <Trigger Property="IsEnabled" Value="False"> |
| 207 | + <Setter Property="Opacity" Value="0.5" /> |
| 208 | + </Trigger> |
| 209 | + <Trigger Property="IsMouseOver" Value="True"> |
| 210 | + <Setter Property="Background" Value="{DynamicResource {x:Static vsshell:VsBrushes.CommandBarHoverKey}}" /> |
| 211 | + </Trigger> |
| 212 | + </ControlTemplate.Triggers> |
| 213 | + </ControlTemplate> |
| 214 | + </Setter.Value> |
| 215 | + </Setter> |
| 216 | + </Style> |
| 217 | + </Border.Resources> |
| 218 | + <StackPanel Orientation="Horizontal"> |
| 219 | + <Button Command="{Binding AddConnectionCommand}" ToolTip="Add Connection"> |
| 220 | + <imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.Add}" /> |
| 221 | + </Button> |
| 222 | + <Button Command="{Binding RefreshCommand}" ToolTip="Refresh"> |
| 223 | + <imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.Refresh}" /> |
| 224 | + </Button> |
| 225 | + <Button Command="{Binding CollapseAllCommand}" ToolTip="Collapse All"> |
| 226 | + <imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.CollapseAll}" /> |
| 227 | + </Button> |
| 228 | + </StackPanel> |
| 229 | + </Border> |
176 | 230 |
|
177 | 231 | <!-- Tree View --> |
178 | 232 | <TreeView Grid.Row="1" |
|
182 | 236 | BorderThickness="0" |
183 | 237 | ContextMenu="{StaticResource RootContextMenu}" |
184 | 238 | VirtualizingStackPanel.IsVirtualizing="True" |
185 | | - VirtualizingStackPanel.VirtualizationMode="Recycling"> |
| 239 | + VirtualizingStackPanel.VirtualizationMode="Recycling" |
| 240 | + theming:ImageThemingUtilities.ImageBackgroundColor="{DynamicResource {x:Static vsshell:VsColors.ToolWindowBackgroundKey}}"> |
186 | 241 | <TreeView.ItemContainerStyle> |
187 | 242 | <Style TargetType="TreeViewItem"> |
188 | 243 | <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> |
|
0 commit comments