ChatGPTAIRewritingContent.xaml 5.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <UserControl x:Class="PDF_Master.Views.HomePanel.ChatGPTAI.ChatGPTAIRewritingContent"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:convert="clr-namespace:PDF_Master.DataConvert"
  4. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  5. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:local="clr-namespace:PDF_Master.Views.HomePanel.ChatGPTAI"
  9. xmlns:converter="clr-namespace:PDF_Master.DataConvert"
  10. xmlns:prism ="http://prismlibrary.com/"
  11. prism:ViewModelLocator.AutoWireViewModel="True"
  12. Background="White" MinWidth="540" MinHeight="460"
  13. mc:Ignorable="d"
  14. d:DesignHeight="760" d:DesignWidth="1032"
  15. >
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <convert:SizeBrushConvert x:Key="SizeBrushConvert" />
  19. <convert:SizeToBoolConvert x:Key="SizeToBoolConvert"/>
  20. </ResourceDictionary>
  21. </UserControl.Resources>
  22. <Grid Margin="0,0,0,0">
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="1*" />
  25. <RowDefinition Height="1.06*" />
  26. </Grid.RowDefinitions>
  27. <StackPanel Grid.Row="0">
  28. <Grid >
  29. <StackPanel HorizontalAlignment="Left">
  30. <TextBlock Text="AI Rewriting" FontFamily="Segoe UI" Margin="0,16,0,0"
  31. FontSize="20"
  32. FontWeight="Bold"
  33. Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28" HorizontalAlignment="Left"></TextBlock>
  34. <TextBlock
  35. HorizontalAlignment="Center"
  36. FontFamily="Segoe UI"
  37. FontSize="14"
  38. Foreground="#94989C"
  39. Text="Limited to 150 characters per session, 5 times per month"
  40. TextAlignment="Center"
  41. TextWrapping="Wrap"
  42. />
  43. </StackPanel>
  44. <Button HorizontalAlignment="Right" Width="104" Height="32" Content="Rewrite" VerticalAlignment="Bottom" Style="{StaticResource Btn.cta}" Command="{Binding RewriteCommand}" IsEnabled="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length, Converter={StaticResource SizeToBoolConvert}}"></Button>
  45. </Grid>
  46. <Grid Height="260" Margin="0,12,0,0" >
  47. <cus:TextBoxEx x:Name="textBoxEnterCharacters" Height="260" Text="{Binding InputText}" FontFamily="Segoe UI" ShowClose="False" PlaceholderText="Please enter text content here..." VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8">
  48. </cus:TextBoxEx>
  49. <TextBlock Text="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length,StringFormat={}{0}/150}" Foreground="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length, Converter={StaticResource SizeBrushConvert}}" Panel.ZIndex="1" Height="22" FontSize="14" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,12,8"/>
  50. </Grid>
  51. </StackPanel>
  52. <StackPanel Grid.Row="1" >
  53. <Grid Height="84" >
  54. <TextBlock Text="Result" FontFamily="Segoe UI"
  55. FontSize="20"
  56. FontWeight="Bold"
  57. VerticalAlignment="Bottom" Margin="0,0,0,12"
  58. Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28" HorizontalAlignment="Left"></TextBlock>
  59. <Grid HorizontalAlignment="Right">
  60. <cus:ToastControl
  61. HorizontalAlignment="Center"
  62. VerticalAlignment="Top"
  63. Width="72"
  64. Height="32"
  65. Margin="0,0,0,4"
  66. Padding="0,4,0,0"
  67. Background="{StaticResource color.sys.layout.dark.bg}"
  68. BeginTime="0:0:0:3"
  69. CornerRadius="4"
  70. FontSize="14"
  71. Foreground="White"
  72. StringContent="Copied"
  73. Visibility="{Binding ShowTip, Mode=TwoWay}"
  74. Duration="0:0:0:3" />
  75. <Button HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,12" Width="104" Height="32" Content="Copy" Background="White" Command="{Binding CopyCommand}" Style="{StaticResource btn.sec}" IsEnabled="{Binding ElementName=RewriteTextBoxEx,Path=Text.Length, Converter={StaticResource SizeToBoolConvert}}"></Button>
  76. </Grid>
  77. </Grid>
  78. <Grid>
  79. <Border Height="260" Panel.ZIndex="1" BorderBrush="{StaticResource color.field.border.error}" Effect="{StaticResource shadow.error.s}" Visibility="{Binding ErrorVisible}" BorderThickness="1" CornerRadius="4" >
  80. <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="16">
  81. <Grid Width="16" Height="16" Margin="4,0,8,0">
  82. <Ellipse Width="14" Height="14" Fill="#F3465B"></Ellipse>
  83. <Path Data="M7.25 4V9H8.75V4H7.25ZM7.25 10.5V12H8.75L8.75 10.5H7.25Z" Fill="white"/>
  84. </Grid>
  85. <TextBlock Text="{Binding ErrorTipText}" FontSize="14" FontFamily="SF Pro Text" Foreground="White" VerticalAlignment="Center"></TextBlock>
  86. </StackPanel>
  87. </Border>
  88. <cus:TextBoxEx x:Name="RewriteTextBoxEx" Height="260" Text="{Binding RewriteText}" FontFamily="Segoe UI" ShowClose="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" IsReadOnly="True">
  89. </cus:TextBoxEx>
  90. </Grid>
  91. </StackPanel>
  92. </Grid>
  93. </UserControl>