AddEntryWindow.xaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <Window x:Class="LocalizationTool.Views.AddEntryWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="新增词条" Height="520" Width="540"
  5. WindowStartupLocation="CenterOwner"
  6. Background="#F5F6FA">
  7. <Grid Margin="24">
  8. <Grid.RowDefinitions>
  9. <RowDefinition Height="Auto"/>
  10. <RowDefinition Height="*"/>
  11. <RowDefinition Height="Auto"/>
  12. </Grid.RowDefinitions>
  13. <TextBlock Text="新增词条" FontSize="16" FontWeight="Bold" Foreground="#333" Margin="0,0,0,12"/>
  14. <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
  15. <StackPanel>
  16. <TextBlock Text="中文原文(key)*" FontSize="12" Foreground="#666" Margin="0,0,0,6"/>
  17. <TextBox Height="32" VerticalContentAlignment="Center" Style="{StaticResource TextBoxExtend}"
  18. Text="{Binding Key, UpdateSourceTrigger=PropertyChanged}"/>
  19. <TextBlock Text="各语言译文(可留空 = 缺译,之后用“仅翻译缺译”补)" FontSize="12"
  20. Foreground="#666" Margin="0,18,0,6"/>
  21. <ItemsControl ItemsSource="{Binding Fields}">
  22. <ItemsControl.ItemTemplate>
  23. <DataTemplate>
  24. <StackPanel Margin="0,0,0,10">
  25. <TextBlock Text="{Binding Label}" FontSize="12" Foreground="#666" Margin="0,0,0,4"/>
  26. <TextBox Height="30" VerticalContentAlignment="Center" Style="{StaticResource TextBoxExtend}"
  27. Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
  28. </StackPanel>
  29. </DataTemplate>
  30. </ItemsControl.ItemTemplate>
  31. </ItemsControl>
  32. <TextBlock Text="(当前没有加载目标语言,仅新增中文源词条)" FontSize="11" Foreground="#999"
  33. Visibility="{Binding HasNoFields, Converter={StaticResource BoolToVis}}" Margin="0,4,0,0"/>
  34. </StackPanel>
  35. </ScrollViewer>
  36. <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,18,0,0">
  37. <Button Content="确定" Width="88" Style="{StaticResource ButtonPrimary}"
  38. Command="{Binding ConfirmCommand}" Margin="0,0,10,0"/>
  39. <Button Content="取消" Width="88" Style="{StaticResource ButtonDefault}"
  40. Command="{Binding CancelCommand}"/>
  41. </StackPanel>
  42. </Grid>
  43. </Window>