<Window x:Class="DataLoader.MainWindow"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
Height="700" Width="900" Loaded="Window_Loaded" Closing="Window_Closing"
|
Title="数据入库 v1.72" WindowStartupLocation="CenterScreen">
|
<Window.Resources>
|
<Style x:Key="btn" TargetType="Button">
|
<Setter Property="Background" Value="#005699"/>
|
<Setter Property="BorderBrush" Value="#136BAF"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="Foreground" Value="White"/>
|
<Setter Property="FontSize" Value="15"/>
|
<Setter Property="Width" Value="60"/>
|
<Setter Property="Height" Value="30"/>
|
<Setter Property="Cursor" Value="Hand"/>
|
<Style.Triggers>
|
<Trigger Property="IsMouseOver" Value="True">
|
<Setter Property="Foreground" Value="Red"/>
|
</Trigger>
|
</Style.Triggers>
|
</Style>
|
<Style x:Key="tb" TargetType="TextBox">
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
<Setter Property="Height" Value="30"/>
|
<Setter Property="FontSize" Value="16"/>
|
</Style>
|
|
<!--Combox-->
|
<Style TargetType="ToggleButton" x:Key="ComboxStyleBtn">
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate>
|
<!--下拉按钮内部背景色-->
|
<Border x:Name="Back" BorderThickness="1" BorderBrush="Transparent">
|
<!--下拉按钮内边框-->
|
<Path Name="PathFill" Fill="#136BAF" Width="10" Height="6" StrokeThickness="0" Data="M5,0 L10,10 L0,10 z" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
|
<Path.RenderTransform>
|
<TransformGroup>
|
<ScaleTransform/>
|
<SkewTransform/>
|
<RotateTransform Angle="180"/>
|
<TranslateTransform/>
|
</TransformGroup>
|
</Path.RenderTransform>
|
</Path>
|
</Border>
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsMouseOver" Value="True">
|
<Setter TargetName="PathFill" Property="Fill" Value="White"></Setter>
|
<Setter TargetName="Back" Property="Background" Value="#136BAF"></Setter>
|
<Setter TargetName="Back" Property="BorderBrush" Value="#136BAF"></Setter>
|
</Trigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
<Style TargetType="ComboBox" x:Key="ComboBoxStyle">
|
<Setter Property="ItemContainerStyle">
|
<Setter.Value>
|
<!--ComBoxItem-->
|
<Style TargetType="ComboBoxItem">
|
<Setter Property="MinHeight" Value="30"></Setter>
|
<Setter Property="MinWidth" Value="60"></Setter>
|
<Setter Property="Foreground" Value="White"></Setter>
|
<Setter Property="FontWeight" Value="Bold"></Setter>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="ComboBoxItem">
|
<Border Name="Back" Background="Transparent" BorderThickness="0,0,0,0" BorderBrush="#136BAF" >
|
<ContentPresenter ContentSource="{Binding Source}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 0 30 0"></ContentPresenter>
|
</Border>
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsMouseOver" Value="True">
|
<Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
|
</Trigger>
|
<!--下拉框背景色-->
|
<Trigger Property="IsHighlighted" Value="True">
|
<Setter TargetName="Back" Property="Background" Value="Transparent"></Setter>
|
</Trigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
</Setter.Value>
|
</Setter>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="ComboBox">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="0.7*"/>
|
<ColumnDefinition Width="0.3*" MaxWidth="30"/>
|
</Grid.ColumnDefinitions>
|
<!--文字区域背景和边线样式-->
|
<TextBox Background="Transparent" HorizontalContentAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Foreground="White" BorderBrush="#136BAF" BorderThickness="0,0,0,0" IsReadOnly="{TemplateBinding IsReadOnly}" Text="{TemplateBinding Text}"></TextBox>
|
<Border Grid.Column="0" BorderThickness="1,1,0,1" BorderBrush="#136BAF" CornerRadius="0,0,0,0">
|
</Border>
|
<!--右侧下拉button设置-->
|
<Border Grid.Column="1" BorderThickness="0,1,1,1" BorderBrush="#136BAF" CornerRadius="0,0,0,0">
|
<ToggleButton BorderThickness="3" BorderBrush="#136BAF" Style="{StaticResource ComboxStyleBtn}" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"></ToggleButton>
|
</Border>
|
<!--弹出popup整体设置-->
|
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide" >
|
<!--弹出popup边框-->
|
<Border CornerRadius="1" BorderBrush="#136BAF" BorderThickness="1,0,1,1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
|
<Border.Effect>
|
<DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="1"/>
|
</Border.Effect>
|
<!--下拉幕布边界背景设置 MaxHeight="{TemplateBinding MaxDropDownHeight}"-->
|
<ScrollViewer Margin="0,0,0,0" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" BorderBrush="#136BAF" BorderThickness="2" >
|
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
|
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="#001f55" />
|
</ScrollViewer>
|
</Border>
|
</Popup>
|
</Grid>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
<Style TargetType="ListBoxItem">
|
<Setter Property="Height" Value="35"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
</Style>
|
|
<Style TargetType="DatePickerTextBox">
|
<Setter Property="ItemsControl.Template">
|
<Setter.Value>
|
<ControlTemplate>
|
<TextBox BorderThickness="0" Text="{Binding Path=SelectedDate, StringFormat='yyyy-MM-dd HH:mm:ss', RelativeSource={RelativeSource AncestorType=DatePicker}}" />
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
</Window.Resources>
|
<Grid x:Name="gMain">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="*"/>
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="5*" />
|
<ColumnDefinition Width="20*" />
|
<ColumnDefinition Width="5*" />
|
<ColumnDefinition Width="20*" />
|
<ColumnDefinition Width="5*" />
|
</Grid.ColumnDefinitions>
|
|
<Label Grid.Row="0" Grid.Column="0" Content="用户ID:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource tb}" IsReadOnly="True" x:Name="tbUid"/>
|
<Label Grid.Row="0" Grid.Column="2" Content="用户名:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<TextBox Grid.Row="0" Grid.Column="3" Style="{StaticResource tb}" IsReadOnly="True" x:Name="tbUname"/>
|
<Button Grid.Row="0" Grid.Column="4" Content="登 录" Style="{StaticResource btn}" Click="Login_MouseLeftButtonDown"/>
|
|
<Label Grid.Row="1" Grid.Column="0" Content="令牌:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource tb}" IsReadOnly="True" x:Name="tbToken"/>
|
<Label Grid.Row="1" Grid.Column="2" Content="采集时间:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<DatePicker Grid.Row="1" Grid.Column="3" Height="35" Width="320" HorizontalAlignment="Center" VerticalContentAlignment="Center" x:Name="dpAcqTime" FontSize="13"/>
|
|
<Label Grid.Row="2" Grid.Column="0" Content="传感器类型:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<!--<TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource tb}" x:Name="tbSensorType"/>-->
|
<ComboBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" VerticalContentAlignment="Center" Cursor="Hand" Background="White" SelectedIndex="0" Width="322" Height="38" BorderThickness="0" x:Name="tbSensorType">
|
<ComboBoxItem Tag="0">请选择</ComboBoxItem>
|
<ComboBoxItem Tag="1">嫦娥一号</ComboBoxItem>
|
<ComboBoxItem Tag="2">嫦娥二号</ComboBoxItem>
|
<ComboBoxItem Tag="3">科普教育</ComboBoxItem>
|
<ComboBoxItem Tag="4">克莱门汀</ComboBoxItem>
|
<ComboBoxItem Tag="5">月球探勘者</ComboBoxItem>
|
<ComboBoxItem Tag="6">月亮女神</ComboBoxItem>
|
<ComboBoxItem Tag="7">月球勘测轨道器</ComboBoxItem>
|
<ComboBoxItem Tag="8">圣杯号</ComboBoxItem>
|
</ComboBox>
|
<Label Grid.Row="2" Grid.Column="2" Content="元数据类型:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<!--<ComboBox Grid.Row="1" Grid.Column="3" IsReadOnly="True" DisplayMemberPath="Name" Style="{StaticResource ComboBoxStyle}" Width="320" Height="30" HorizontalAlignment="Left" x:Name="cbMetaType"></ComboBox>-->
|
<ComboBox Grid.Row="2" Grid.Column="3" HorizontalAlignment="Left" VerticalContentAlignment="Center" Cursor="Hand" Background="White" SelectedIndex="0" Width="322" Height="38" BorderThickness="0" x:Name="cbMetaType">
|
<ComboBoxItem Tag="0">请选择</ComboBoxItem>
|
<ComboBoxItem Tag="1">数字正射影像图</ComboBoxItem>
|
<ComboBoxItem Tag="2">数字高程模型</ComboBoxItem>
|
<ComboBoxItem Tag="3">单波段栅格数据</ComboBoxItem>
|
<ComboBoxItem Tag="4">多光谱栅格数据</ComboBoxItem>
|
<ComboBoxItem Tag="5">高光谱栅格数据</ComboBoxItem>
|
<ComboBoxItem Tag="6">矢量数据</ComboBoxItem>
|
<ComboBoxItem Tag="7">三维模型</ComboBoxItem>
|
</ComboBox>
|
|
<Label Grid.Row="3" Grid.Column="0" Content="资源目录:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<TextBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" Style="{StaticResource tb}" IsReadOnly="True" x:Name="tbDir"/>
|
<Button Grid.Row="3" Grid.Column="4" Content="选 择" Style="{StaticResource btn}" Click="Dir_MouseLeftButtonDown" x:Name="btnDir"/>
|
|
<Label Grid.Row="4" Grid.Column="0" Content="数据目录:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Style="{StaticResource tb}" x:Name="tbSource"/>
|
<Button Grid.Row="4" Grid.Column="4" Content="选 择" Style="{StaticResource btn}" Click="Source_MouseLeftButtonDown" x:Name="btnSource"/>
|
|
<Label Grid.Row="5" Grid.Column="0" Content="入库目录:" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
<TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3" Style="{StaticResource tb}" x:Name="tbTarget" IsReadOnly="False" />
|
<Button Grid.Row="5" Grid.Column="4" Content="选 择" Style="{StaticResource btn}" Click="Target_MouseLeftButtonDown" x:Name="btnTarget" Visibility="Hidden" />
|
|
<ScrollViewer Grid.Row="6" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="4" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="5 5 0 5">
|
<ListView x:Name="lvView">
|
<ListView.View>
|
<GridView>
|
<GridView.Columns>
|
<GridViewColumn Width="30">
|
<GridViewColumn.CellTemplate>
|
<DataTemplate>
|
<CheckBox IsChecked="{Binding Path=Checked, Mode=TwoWay}" Tag="{Binding Path=ID, Mode=OneWay}" />
|
</DataTemplate>
|
</GridViewColumn.CellTemplate>
|
</GridViewColumn>
|
<GridViewColumn Header="序号" Width="Auto">
|
<GridViewColumn.CellTemplate>
|
<DataTemplate>
|
<TextBlock Text="{Binding Path=ID, Mode=OneWay}" TextAlignment="Center" MinWidth="{Binding Path=ActualWidth, ElementName=column}" HorizontalAlignment="Center"/>
|
</DataTemplate>
|
</GridViewColumn.CellTemplate>
|
</GridViewColumn>
|
<GridViewColumn Header="路径" Width="Auto" DisplayMemberBinding="{Binding Path=FilePath, Mode=OneWay}"/>
|
<GridViewColumn Header="文件大小" Width="Auto" DisplayMemberBinding="{Binding Path=Sizes, Mode=OneWay}"/>
|
<GridViewColumn Header="运行状态" Width="120" DisplayMemberBinding="{Binding Path=Status, Mode=OneWay}"/>
|
</GridView.Columns>
|
</GridView>
|
</ListView.View>
|
</ListView>
|
</ScrollViewer>
|
|
<Button x:Name="btnLoad" Grid.Row="6" Grid.Column="4" Content="加 载" Style="{StaticResource btn}" Click="Load_MouseLeftButtonDown"/>
|
<Button x:Name="btnDel" Grid.Row="7" Grid.Column="4" Content="删 除" Style="{StaticResource btn}" Click="Del_MouseLeftButtonDown"/>
|
<Button x:Name="btnImport" Grid.Row="8" Grid.Column="4" Content="导 入" Style="{StaticResource btn}" VerticalAlignment="Top" Click="Import_MouseLeftButtonDown"/>
|
</Grid>
|
</Window>
|