123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <UserControl x:Class="PDF_Master.Views.Dialog.ChatGPTAIDialogs.SelectedTranslationDialog"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:convert="clr-namespace:PDF_Master.DataConvert"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:cus="clr-namespace:PDF_Master.CustomControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- Width="548"
- Height="342"
- d:DesignHeight="342"
- d:DesignWidth="548"
- prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
- Background="White"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <convert:SizeBrushConvert x:Key="SizeBrushConvert" />
- <convert:SizeToBoolConvert x:Key="SizeToBoolConvert"/>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="50"></RowDefinition>
- <RowDefinition Height="*"></RowDefinition>
- </Grid.RowDefinitions>
- <Border Grid.RowSpan="2"
- Panel.ZIndex="1" Background="Transparent" Visibility="{Binding ProgressVisible}">
- <Border
- Width="226"
- Height="58"
- Background="{StaticResource color.sys.layout.dark.bg}"
- BorderThickness="0"
- CornerRadius="{StaticResource border-radius.8}"
- Effect="{StaticResource shadow.neutral.m}"
- >
- <Grid Margin="16,13" Background="Transparent">
- <StackPanel Orientation="Horizontal">
- <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="Translating..." />
- <TextBlock
- Foreground="{StaticResource color.sys.text.anti.norm}"
- Text="{Binding Value, StringFormat={}({0})}"
- Visibility="Collapsed" />
- </StackPanel>
- <Button
- Width="12"
- Height="12"
- Padding="0,0,1,1"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- Background="{StaticResource color.sys.layout.dark.bg}"
- BorderThickness="0"
- Visibility="Collapsed">
- <Path Data="M6.00006 7.06072L9.46973 10.5304L10.5304 9.46973L7.06072 6.00006L10.5304 2.53039L9.46973 1.46973L6.00006 4.9394L2.53039 1.46973L1.46973 2.53039L4.9394 6.00006L1.46973 9.46973L2.53039 10.5304L6.00006 7.06072Z" Fill="#CED0D4" />
- </Button>
- <ProgressBar
- Height="4"
- Margin="0,0,0,4"
- VerticalAlignment="Bottom"
- BorderThickness="0"
- Foreground="{StaticResource color.slider.track-filled.norm}"
- Maximum="{Binding MaxValue}"
- Value="{Binding Value}" />
- </Grid>
- </Border>
- </Border>
- <Grid Grid.Row="0">
- <StackPanel Orientation="Horizontal">
- <TextBlock Margin="16,0,0,0" Text="{Binding T_Title}" FontFamily="Segoe UI"
- FontSize="16"
- FontWeight="Bold"
- Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28"></TextBlock>
- <Grid Width="16" Height="16" Margin="4,0,0,4" WindowChrome.IsHitTestVisibleInChrome="True">
- <Grid.ToolTip>
- <ToolTip Background="Transparent" BorderBrush="Transparent">
- <Border Background="{StaticResource color.sys.layout.dark.bg}" Width="255" Height="66" CornerRadius="4">
- <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="240" FontSize="12" Text="{Binding T_LimitTip}" />
- </Border>
- </ToolTip>
- </Grid.ToolTip>
- <Ellipse Width="14" Height="14" Fill="white" Stroke="#CED0D4">
- </Ellipse>
- <Path Data="M7.4701 8.91H8.5001L8.7601 5.49L8.8101 4H7.1601L7.2101 5.49L7.4701 8.91ZM7.9901 11.58C8.4901 11.58 8.8701 11.21 8.8701 10.69C8.8701 10.17 8.4901 9.81 7.9901 9.81C7.4801 9.81 7.1001 10.17 7.1001 10.69C7.1001 11.21 7.4701 11.58 7.9901 11.58Z" Fill="#94989C"/>
- </Grid>
- </StackPanel>
- <Button
- Width="46"
- Height="32"
- Margin="8"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- Background="Transparent"
- IsCancel="True"
- Style="{StaticResource CloseBtn}"
- WindowChrome.IsHitTestVisibleInChrome="True">
- <Path
- Width="46"
- Height="32"
- Data="M23 17.708L18.8545 21.8535C18.7568 21.9512 18.6396 22 18.5029 22C18.3597 22 18.2393 21.9528 18.1416 21.8584C18.0472 21.7607 18 21.6403 18 21.4971C18 21.3604 18.0488 21.2432 18.1465 21.1455L22.292 17L18.1465 12.8545C18.0488 12.7568 18 12.638 18 12.498C18 12.4297 18.013 12.3646 18.0391 12.3027C18.0651 12.2409 18.1009 12.1888 18.1465 12.1465C18.1921 12.1009 18.2458 12.0651 18.3076 12.0391C18.3695 12.013 18.4346 12 18.5029 12C18.6396 12 18.7568 12.0488 18.8545 12.1465L23 16.292L27.1455 12.1465C27.2432 12.0488 27.362 12 27.502 12C27.5703 12 27.6338 12.013 27.6924 12.0391C27.7542 12.0651 27.8079 12.1009 27.8535 12.1465C27.8991 12.1921 27.9349 12.2458 27.9609 12.3076C27.987 12.3662 28 12.4297 28 12.498C28 12.638 27.9512 12.7568 27.8535 12.8545L23.708 17L27.8535 21.1455C27.9512 21.2432 28 21.3604 28 21.4971C28 21.5654 27.987 21.6305 27.9609 21.6924C27.9349 21.7542 27.8991 21.8079 27.8535 21.8535C27.8112 21.8991 27.7591 21.9349 27.6973 21.9609C27.6354 21.987 27.5703 22 27.502 22C27.362 22 27.2432 21.9512 27.1455 21.8535L23 17.708Z"
- Fill="Black" />
- </Button>
- </Grid>
- <Grid Grid.Row="1" >
- <StackPanel>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="16,16,0,0">
- <TextBlock Text="{Binding T_TranslationLanguage}" Height="22"></TextBlock>
- <ComboBox Width="165" Height="32" Margin="12,0,0,0" ItemsSource="{Binding FromlanguageFamily}" SelectedIndex="{Binding FromlanguageIndex}"></ComboBox>
- <Path Width="24" Height="24" Margin="8,0,8,0" Data="M15.7071 2.79289C15.3166 2.40237 14.6834 2.40237 14.2929 2.79289C13.9024 3.18342 13.9024 3.81658 14.2929 4.20711L18.5858 8.5H3C2.44772 8.5 2 8.94772 2 9.5C2 10.0523 2.44772 10.5 3 10.5H21C21.1374 10.5 21.2683 10.4723 21.3874 10.4222C21.4946 10.3772 21.5955 10.3127 21.6848 10.2288C21.6999 10.2145 21.7147 10.1998 21.7289 10.1846C21.8115 10.0968 21.8753 9.99761 21.9201 9.89233C21.9715 9.77187 22 9.63926 22 9.5C22 9.36074 21.9715 9.22813 21.9201 9.10767C21.8753 9.00239 21.8115 8.90324 21.7289 8.81538C21.721 8.80691 21.7129 8.79858 21.7046 8.7904L15.7071 2.79289ZM18.9852 15.5L14.6923 19.7929C14.3018 20.1834 14.3018 20.8166 14.6923 21.2071C15.0828 21.5976 15.716 21.5976 16.1065 21.2071L22.1065 15.2071C22.497 14.8166 22.497 14.1834 22.1065 13.7929C21.9973 13.6837 21.8691 13.605 21.7325 13.5568C21.6283 13.52 21.5161 13.5 21.3993 13.5H21.399H3.39928C2.84699 13.5 2.39928 13.9477 2.39928 14.5C2.39928 15.0523 2.84699 15.5 3.39928 15.5H18.9852Z" Fill="#CED0D4"></Path>
- <ComboBox Width="165" Height="32" ItemsSource="{Binding TolanguageFamily}" SelectedIndex="{Binding TolanguageIndex}"></ComboBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0,16,0,0">
- <StackPanel>
- <Grid Width="250" Height="180" Margin="16,0,0,0">
- <cus:TextBoxEx x:Name="textBoxEnterCharacters" Width="250" Height="180" Text="{Binding SelectedText}" FontFamily="Segoe UI" ShowClose="False" PlaceholderText="{Binding T_TextBoxWatermark}" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" >
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="TextChanged">
- <i:InvokeCommandAction Command="{Binding textBoxEnterCharactersTextChangedCommad}" CommandParameter="{Binding ElementName=textBoxEnterCharacters}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </cus:TextBoxEx>
- <TextBlock x:Name="SizeTextBlock" Text="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length,StringFormat={}{0}/150}" Panel.ZIndex="1" Height="22" FontSize="14" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,12,8" Foreground="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length, Converter={StaticResource SizeBrushConvert}}"/>
- </Grid>
- <Button HorizontalAlignment="Right" Width="97" Height="24" Content="{Binding T_TranslationBtn}" VerticalAlignment="Bottom" Style="{StaticResource Btn.cta}" Margin="0,8,0,0" Command="{Binding TranslateCommand}" IsEnabled="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length, Converter={StaticResource SizeToBoolConvert}}"></Button>
- </StackPanel>
- <StackPanel>
- <Grid>
- <Border Width="250" Height="180" Margin="16,0,0,0" Panel.ZIndex="1" BorderBrush="{StaticResource color.field.border.error}" Visibility="{Binding ErrorVisible}" BorderThickness="1" CornerRadius="4" >
- <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="16">
- <Grid Width="16" Height="16" Margin="4,0,8,0" VerticalAlignment="Top">
- <Ellipse Width="14" Height="14" Fill="#F3465B"></Ellipse>
- <Path Data="M7.25 4V9H8.75V4H7.25ZM7.25 10.5V12H8.75L8.75 10.5H7.25Z" Fill="white"/>
- </Grid>
- <TextBlock Text="{Binding ErrorTipText}" FontSize="14" FontFamily="SF Pro Text" Foreground="#F3465B" VerticalAlignment="Center" TextWrapping="Wrap" Width="180"></TextBlock>
- </StackPanel>
- </Border>
- <cus:TextBoxEx x:Name="TranslateTextBoxEx" Width="250" Height="180" Margin="16,0,0,0" Text="{Binding TranslateText}" FontFamily="Segoe UI" ShowClose="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" IsReadOnly="True">
- </cus:TextBoxEx>
- </Grid>
-
- <Button HorizontalAlignment="Right" Width="97" Height="24" Content="{Binding T_Copy}" VerticalAlignment="Bottom" Margin="0,8,0,0" Command="{Binding CopyCommand}" IsEnabled="{Binding ElementName=TranslateTextBoxEx,Path=Text.Length, Converter={StaticResource SizeToBoolConvert}}" Style="{StaticResource btn.sec}"></Button>
- </StackPanel>
- </StackPanel>
- </StackPanel>
- <cus:ToastControl
- HorizontalAlignment="Right"
- VerticalAlignment="Bottom"
- Width="72"
- Height="32"
- Margin="0,0,25,44"
- Padding="0,4,0,0"
- Background="{StaticResource color.sys.layout.dark.bg}"
- BeginTime="0:0:0:3"
- CornerRadius="4"
- FontSize="14"
- Panel.ZIndex="1"
- Foreground="White"
- StringContent="{Binding T_Copied}"
- Visibility="{Binding ShowTip, Mode=TwoWay}"
- Duration="0:0:0:3" />
- </Grid>
- </Grid>
- </UserControl>
|