Files
better-genshin-impact/BetterGenshinImpact/View/Windows/PromptDialog.xaml
辉鸭蛋 fc942bd8cd feat: 为多个窗口启用自动翻译拦截器
为 MapLabelSearchWindow、ArtifactOcrDialog、PromptDialog 等十三个 WPF 窗口添加了 AutoTranslateInterceptor 行为,以启用自动翻译功能。这确保了应用程序界面的文本内容在需要时可以被正确拦截并处理,提升国际化支持。
2026-01-28 01:22:09 +08:00

92 lines
3.9 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<ui:FluentWindow x:Class="BetterGenshinImpact.View.Windows.PromptDialog"
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:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:behavior="clr-namespace:BetterGenshinImpact.View.Behavior"
Width="500"
Height="225"
MinWidth="400"
MinHeight="200"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ExtendsContentIntoTitleBar="True"
behavior:AutoTranslateInterceptor.EnableAutoTranslate="True"
FontFamily="{DynamicResource TextThemeFontFamily}"
SizeToContent="Width"
WindowBackdropType="Auto"
WindowStartupLocation="CenterScreen"
WindowStyle="SingleBorderWindow"
mc:Ignorable="d">
<!--移除了ResizeMode="CanMinimize"属性。ui:FluentWindow即使设置了这个属性也无法简单地禁止用户调整窗口大小QAQ-->
<!--将内容部分和按钮部分分开。用户自由调整窗口大小时,按钮部分固定在底部,内容部分可以自适应滚动条-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!--<StackPanel Grid.Row="1" Margin="12">
<ui:TextBlock Name="TxtQuestion" Margin="5" />
--><!--<ui:TextBox Name="TxtResponse" Margin="5" />--><!--
<ContentControl Name="DynamicContent" Margin="5" />
</StackPanel>-->
<!--内容部分-->
<Grid Grid.Row="1" Margin="12,12,12,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ui:TextBlock Name="TxtQuestion" Margin="5" Grid.Row="0"/>
<ContentControl Name="DynamicContent" Margin="5" Grid.Row="1"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
</Grid>
<!--按钮部分-->
<Grid Grid.Row="2" Margin="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 左下角按钮 -->
<ui:Button Name="BtnLeftBottom"
Margin="5"
HorizontalAlignment="Left"
Appearance="Success"
Content="左下角按钮"
Grid.Column="0" />
<!-- 原有的右侧按钮 -->
<StackPanel Grid.Column="1"
Orientation="Horizontal">
<ui:Button Name="BtnOk"
Margin="5"
Appearance="Primary"
Click="BtnOkClick"
Content="确定"
IsDefault="True" />
<ui:Button Name="BtnCancel"
Margin="5"
Click="BtnCancelClick"
Content="取消"
IsCancel="True" />
</StackPanel>
</Grid>
<ui:TitleBar Name="MyTitleBar" Grid.Row="0">
<ui:TitleBar.Icon>
<ui:ImageIcon Source="pack://application:,,,/Resources/Images/logo.png" />
</ui:TitleBar.Icon>
</ui:TitleBar>
</Grid>
</ui:FluentWindow>