123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <Window x:Class="TranslateTool.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:TranslateTool"
- xmlns:views="clr-namespace:TranslateTool.Views"
- mc:Ignorable="d" Closed="Window_Closed"
- Title="翻译工具" Height="700" Width="800">
- <Window.Resources>
- <ResourceDictionary>
- <SolidColorBrush Color="#abd8fe" x:Key="ListItemSelecctedBlueBrush"/>
- <SolidColorBrush Color="#cfe8ff" x:Key="ListItemMoveOverBlueBrush"/>
- <Style TargetType="{x:Type ListBoxItem}" x:Key="ListBoxItemStyle">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Grid x:Name="Container" Height="25" Background="{TemplateBinding Background}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="30"></ColumnDefinition>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Column="0" Text="{Binding Path=Index}" VerticalAlignment="Center"/>
- <TextBlock Grid.Column="1" Text="{Binding Path=KeyValue}" Margin="10,0,0,0"
- VerticalAlignment="Center" TextAlignment="Left"/>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="{StaticResource ListItemMoveOverBlueBrush}"/>
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="{StaticResource ListItemSelecctedBlueBrush}"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style TargetType="{x:Type ComboBoxItem}" x:Key="ComboxItemStyle">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Grid x:Name="Container" Height="25" Background="{TemplateBinding Background}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="25"/>
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Column="0" Text="{Binding}" VerticalAlignment="Center" TextAlignment="Left"/>
- <views:ImageButton Grid.Column="1" ImageSource="Resources/Images/BlackClose.png"
- Command="{Binding DataContext.DeleteCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ComboBox}}}" CommandParameter="{Binding}"/>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="{StaticResource ListItemMoveOverBlueBrush}"/>
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="{StaticResource ListItemSelecctedBlueBrush}"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style TargetType="{x:Type ComboBoxItem}" x:Key="FixedComboxItemStyle">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <StackPanel Orientation="Horizontal" Height="25" Background="{TemplateBinding Background}">
- <Image Source="Resources/Images/Add.png" Width="15" Margin="0 0 5 0" VerticalAlignment="Center"/>
- <TextBlock Text="添加" VerticalAlignment="Center" TextAlignment="Left"/>
- </StackPanel>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="{StaticResource ListItemMoveOverBlueBrush}"/>
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="{StaticResource ListItemSelecctedBlueBrush}"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <CollectionViewSource x:Key="ClientList" Source="{Binding ClientSource}" />
- <CollectionViewSource x:Key="LanguageList" Source="{Binding LanguageSource}" />
- </ResourceDictionary>
- </Window.Resources>
- <Grid Margin="20,20,0,20">
- <Grid.ColumnDefinitions >
- <ColumnDefinition Width="0.35*"/>
- <ColumnDefinition Width="0.65*"/>
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="10"/>
- <RowDefinition Height="25"/>
- <RowDefinition Height="10"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="10"/>
- <RowDefinition Height="30"/>
- </Grid.RowDefinitions>
- <CheckBox Grid.Row="0" Content="仅显示未翻译内容" IsChecked="{Binding ShowUntranslated}"/>
- <Grid Grid.Row="2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <TextBox Grid.Column="0" x:Name="SearchTxt" Text="{Binding SearchKey}"
- Margin="0,0,10,0" KeyDown="UIElement_OnKeyDown"/>
- <Button Grid.Column="1" Content="搜索" Width="50" Command="{Binding SearchCommand}"/>
- </Grid>
- <ListBox Grid.Row="4" x:Name="KeyList" ItemsSource="{Binding LanguageKeys}" SelectedItem="{Binding SelectKey}"
- ItemContainerStyle="{StaticResource ListBoxItemStyle}" />
- <TextBlock Grid.Row="6" Text="{Binding ItemInfo}" Margin="0,0,10,0"/>
- </Grid>
- <Grid Grid.Column="1" Margin="20,0,20,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="25"/>
- <RowDefinition Height="40"/>
- <RowDefinition Height="0.3*"/>
- <RowDefinition Height="10"/>
- <RowDefinition Height="0.3*"/>
- <RowDefinition Height="10"/>
- <RowDefinition Height="35"/>
- <RowDefinition Height="10"/>
- <RowDefinition Height="35"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="80"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
-
- <Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="80"/>
- <ColumnDefinition Width="80"/>
- <ColumnDefinition Width="80"/>
- <ColumnDefinition Width="80"/>
- <ColumnDefinition Width="80"/>
- </Grid.ColumnDefinitions>
- <TextBox Grid.Column="2" Text="{Binding EnglishFileName}" TextAlignment="Center" VerticalContentAlignment="Center"/>
- <Button x:Name="SelectEnglishFile" Content="选择英文文件" Command="{Binding EnglishFileCommand}" HorizontalAlignment="Left" Grid.Column="1"></Button>
- <TextBox Grid.Column="5" Text="{Binding FileName}" TextAlignment="Center" VerticalContentAlignment="Center"/>
- <Button x:Name="SelectFile" Content="选择文件" Command="{Binding FileCommand}" HorizontalAlignment="Center" Grid.Column="3"></Button>
- </Grid>
- <TextBlock Grid.Row="2" Grid.Column="0" Text="文件内容"/>
- <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Content}" IsReadOnly="True"
- TextWrapping="Wrap" GotFocus="TextBox_GotFocus"/>
- <!--<TextBlock Grid.Row="4" Grid.Column="0" Text="翻译"/>
- <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding NewContent}" TextWrapping="Wrap"/>-->
- <!--<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
- Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2">
- <Button Content="导出Txt未翻译内容" x:Name="ExportFile" Margin="0,0,10,0" Width="110" Click="ExportFile_OnClick"/>
- <Button Content="导入已翻译内容" x:Name="ImportFile" Margin="0,0,10,0" Width="100" Click="ImportFile_OnClick"/>
- <Button Content="旧文件转化" x:Name="ConvertOldFile" Margin="0,0,10,0" Width="100" Click="ConvertOldFile_OnClick"/>
- <Button Content="导入最新文件" x:Name="ImportLatestFile" Width="100" Click="ImportLatestFile_OnClick"/>
- </StackPanel>-->
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
- Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="10,0">
- <Button Content="导出Excel未翻译内容" x:Name="ExportExcelFile" Margin="0,0,10,0" Width="120" Click="ExportExcelFile_Click"/>
- <Button Content="导入Excel已翻译内容" x:Name="ImportExcelFile" Margin="0,0,10,0" Width="120" Click="ImportExcelFile_Click"/>
- </StackPanel>
- </Grid>
- </Grid>
- </Window>
|