|
1 | 1 | <UserControl
|
2 |
| - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 |
| - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 |
| - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 |
| - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 |
| - xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0" |
7 |
| - xmlns:Controls="clr-namespace:SQLScriptsExplorer.Addin.Controls" x:Class="SQLScriptsExplorer.Addin.Commands.ToolWindow.MainToolWindowControl" |
8 |
| - Background="{DynamicResource {x:Static vsshell:VsBrushes.WindowKey}}" |
9 |
| - Foreground="{DynamicResource {x:Static vsshell:VsBrushes.WindowTextKey}}" |
10 |
| - mc:Ignorable="d" |
11 |
| - d:DesignHeight="300" d:DesignWidth="300" |
12 |
| - x:Name="MyToolWindow"> |
| 2 | + x:Class="SQLScriptsExplorer.Addin.Commands.ToolWindow.MainToolWindowControl" |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:Controls="clr-namespace:SQLScriptsExplorer.Addin.Controls" |
| 6 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 7 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 8 | + xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0" |
| 9 | + x:Name="MyToolWindow" |
| 10 | + d:DesignHeight="300" |
| 11 | + d:DesignWidth="300" |
| 12 | + Background="{DynamicResource {x:Static vsshell:VsBrushes.WindowKey}}" |
| 13 | + Foreground="{DynamicResource {x:Static vsshell:VsBrushes.WindowTextKey}}" |
| 14 | + mc:Ignorable="d"> |
13 | 15 | <Grid Margin="0,0,0,0">
|
14 |
| - |
15 |
| - <DockPanel> |
| 16 | + <Grid.RowDefinitions> |
| 17 | + <RowDefinition Height="Auto" /> |
| 18 | + <RowDefinition Height="*" /> |
| 19 | + </Grid.RowDefinitions> |
| 20 | + <DockPanel Grid.Row="0"> |
16 | 21 | <StackPanel>
|
17 |
| - <ToolBarTray DockPanel.Dock="Top" IsLocked="True"> |
18 |
| - <ToolBar Loaded="ToolBar_Loaded" BorderThickness="0"> |
| 22 | + <ToolBarTray |
| 23 | + x:Name="mainToolBarTray" |
| 24 | + DockPanel.Dock="Top" |
| 25 | + IsLocked="True"> |
| 26 | + <ToolBar |
| 27 | + x:Name="mainToolBar" |
| 28 | + BorderThickness="0" |
| 29 | + Loaded="ToolBar_Loaded"> |
19 | 30 | <Button Click="btnFormatSelection_Click" ToolTip="Format Selection">
|
20 | 31 | <StackPanel>
|
21 |
| - <Image Source="../../Resources/Images/FormatScript.png" Width="16" /> |
| 32 | + <Image Width="16" Source="../../Resources/Images/FormatScript.png" /> |
22 | 33 | </StackPanel>
|
23 | 34 | </Button>
|
24 | 35 |
|
25 | 36 | <Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
|
26 | 37 |
|
27 | 38 | <Button Click="btnExpandAll_Click" ToolTip="Expand All">
|
28 | 39 | <StackPanel>
|
29 |
| - <Image Source="../../Resources/Images/ExpandAll.png" Width="16" /> |
| 40 | + <Image Width="16" Source="../../Resources/Images/ExpandAll.png" /> |
30 | 41 | </StackPanel>
|
31 | 42 | </Button>
|
32 |
| - |
| 43 | + |
33 | 44 | <Button Click="btnCollapseAll_Click" ToolTip="Collapse All">
|
34 | 45 | <StackPanel>
|
35 |
| - <Image Source="../../Resources/Images/CollapseAll.png" Width="16" /> |
| 46 | + <Image Width="16" Source="../../Resources/Images/CollapseAll.png" /> |
36 | 47 | </StackPanel>
|
37 | 48 | </Button>
|
38 | 49 |
|
39 | 50 | <Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
|
40 | 51 |
|
41 | 52 | <Button Click="btnRefresh_Click" ToolTip="Refresh">
|
42 | 53 | <StackPanel>
|
43 |
| - <Image Source="../../Resources/Images/Refresh.png" Width="16"/> |
| 54 | + <Image Width="16" Source="../../Resources/Images/Refresh.png" /> |
44 | 55 | </StackPanel>
|
45 | 56 | </Button>
|
46 | 57 | <Button Click="btnSettings_Click" ToolTip="Settings">
|
47 | 58 | <StackPanel>
|
48 |
| - <Image Source="../../Resources/Images/Settings.png" Width="16"/> |
| 59 | + <Image Width="16" Source="../../Resources/Images/Settings.png" /> |
49 | 60 | </StackPanel>
|
50 | 61 | </Button>
|
51 | 62 | </ToolBar>
|
52 | 63 | </ToolBarTray>
|
53 |
| - <TextBox x:Name="txtSearch" Height="21" Padding="3,2,3,2" KeyUp="txtSearch_KeyUp" /> |
54 |
| - <TextBlock IsHitTestVisible="False" Text="Search SQL Scripts Explorer..." VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,-23,0,0" Padding="6,2,0,0" Foreground="DarkGray"> |
55 |
| - <TextBlock.Style> |
56 |
| - <Style TargetType="{x:Type TextBlock}"> |
57 |
| - <Setter Property="Visibility" Value="Collapsed"/> |
58 |
| - <Style.Triggers> |
59 |
| - <DataTrigger Binding="{Binding Text, ElementName=txtSearch}" Value=""> |
60 |
| - <Setter Property="Visibility" Value="Visible"/> |
61 |
| - </DataTrigger> |
62 |
| - </Style.Triggers> |
63 |
| - </Style> |
64 |
| - </TextBlock.Style> |
65 |
| - </TextBlock> |
| 64 | + <Grid> |
| 65 | + <Grid.ColumnDefinitions> |
| 66 | + <ColumnDefinition Width="*" /> |
| 67 | + </Grid.ColumnDefinitions> |
| 68 | + <TextBox |
| 69 | + x:Name="txtSearch" |
| 70 | + Grid.Column="0" |
| 71 | + Height="21" |
| 72 | + Padding="3,2,3,2" |
| 73 | + KeyUp="txtSearch_KeyUp" /> |
| 74 | + <TextBlock |
| 75 | + x:Name="lblSearch" |
| 76 | + Grid.Column="0" |
| 77 | + Margin="5,0,0,0" |
| 78 | + HorizontalAlignment="Left" |
| 79 | + VerticalAlignment="Center" |
| 80 | + Background="Transparent" |
| 81 | + IsHitTestVisible="False" |
| 82 | + Text="Search SQL Scripts Explorer..."> |
| 83 | + <TextBlock.Style> |
| 84 | + <Style TargetType="{x:Type TextBlock}"> |
| 85 | + <Setter Property="Visibility" Value="Collapsed" /> |
| 86 | + <Style.Triggers> |
| 87 | + <DataTrigger Binding="{Binding Text, ElementName=txtSearch}" Value=""> |
| 88 | + <Setter Property="Visibility" Value="Visible" /> |
| 89 | + </DataTrigger> |
| 90 | + </Style.Triggers> |
| 91 | + </Style> |
| 92 | + </TextBlock.Style> |
| 93 | + </TextBlock> |
| 94 | + </Grid> |
66 | 95 | </StackPanel>
|
67 | 96 | </DockPanel>
|
68 | 97 |
|
69 |
| - <Controls:FileExplorerTreeView x:Name="FileExplorerAll" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,48,0,0"/> |
70 |
| - <Controls:FileExplorerTreeView x:Name="FileExplorerSearchResults" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,48,0,0" Visibility="Collapsed" |
71 |
| - TreeNodeAdded="FileExplorerSearchResults_TreeNodeAdded" |
72 |
| - TreeNodeDeleted="FileExplorerSearchResults_TreeNodeDeleted" |
73 |
| - TreeNodeRenamed="FileExplorerSearchResults_TreeNodeRenamed"/> |
74 |
| - |
75 |
| - <StackPanel Orientation="Vertical" Margin="0,150,0,0"> |
76 |
| - <!--<StackPanel Orientation="Horizontal">--> |
77 |
| - <!--</StackPanel>--> |
78 |
| - </StackPanel> |
| 98 | + <Controls:FileExplorerTreeView |
| 99 | + x:Name="FileExplorerAll" |
| 100 | + Grid.Row="1" |
| 101 | + Margin="0,0,0,0" |
| 102 | + HorizontalAlignment="Stretch" |
| 103 | + VerticalAlignment="Stretch" /> |
| 104 | + <Controls:FileExplorerTreeView |
| 105 | + x:Name="FileExplorerSearchResults" |
| 106 | + Grid.Row="1" |
| 107 | + Margin="0,0,0,0" |
| 108 | + HorizontalAlignment="Stretch" |
| 109 | + VerticalAlignment="Stretch" |
| 110 | + TreeNodeAdded="FileExplorerSearchResults_TreeNodeAdded" |
| 111 | + TreeNodeDeleted="FileExplorerSearchResults_TreeNodeDeleted" |
| 112 | + TreeNodeRenamed="FileExplorerSearchResults_TreeNodeRenamed" |
| 113 | + Visibility="Collapsed" /> |
79 | 114 |
|
80 |
| - <!-- Info on double click: https://stackoverflow.com/questions/4295897/wpf-double-click-treeviewitem-child-node --> |
| 115 | + <!-- Info on double click: https://stackoverflow.com/questions/4295897/wpf-double-click-treeviewitem-child-node --> |
81 | 116 |
|
82 | 117 |
|
83 | 118 |
|
|
0 commit comments