ExcelHelper/Views/Pages/SqlQueryPage.xaml

88 lines
3.1 KiB
XML

<Page
x:Class="ExcelHelper.Views.Pages.SqlQueryPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:ExcelHelper.Views.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="SqlQueryPage"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<StackPanel
Grid.Row="0"
HorizontalAlignment="Left"
Orientation="Horizontal">
<TextBlock
Margin="10"
VerticalAlignment="Center"
Text="储存类型:"
Visibility="Collapsed" />
<hc:ComboBox
x:Name="SqlQueryComboBox"
Width="200"
Margin="10"
DisplayMemberPath="Name"
SelectedValuePath="Sql"
Visibility="Collapsed" />
<Button
x:Name="ExecuteButton"
Margin="10"
VerticalAlignment="Center"
Click="ExecuteButton_Click"
Content="执行" />
</StackPanel>
<avalonEdit:TextEditor
Name="TextEditor"
Grid.Row="1"
Grid.Column="0"
MinHeight="200"
VerticalAlignment="Stretch"
FontFamily="Consolas"
FontSize="14pt"
LineNumbersForeground="Black"
ShowLineNumbers="True"
SyntaxHighlighting="SQL" />
<ListBox
x:Name="FunctionListBox"
Grid.Row="1"
Grid.Column="1"
Margin="5"
SelectionChanged="FunctionListBox_SelectionChanged">
<ListBoxItem Content="INSTALL spatial; LOAD spatial;" />
<ListBoxItem Content="st_read()" />
<!-- ...add more functions if needed... -->
</ListBox>
<DataGrid
x:Name="ResultDataGrid"
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="5"
HorizontalAlignment="Stretch"
hc:DataGridAttach.CanUnselectAllWithBlankArea="True"
ColumnWidth="*"
MinColumnWidth="100"
ScrollViewer.HorizontalScrollBarVisibility="Auto" />
<StackPanel Grid.Row="3" Orientation="Horizontal">
<TextBlock
x:Name="StatusTextBlock"
Margin="5"
Text="准备就绪" />
</StackPanel>
</Grid>
</Page>