将Feature/XP.Common和Feature/XP.Hardware分支合并至Develop/XP.forHardwareAndCommon,完善XPapp注册和相关硬件类库通用类库功能。
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
<Window x:Class="XP.Common.Localization.Views.LanguageSwitcherWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
xmlns:loc="clr-namespace:XP.Common.Localization.Extensions"
|
||||
xmlns:vm="clr-namespace:XP.Common.Localization.ViewModels"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=vm:LanguageSwitcherViewModel}"
|
||||
Title="{loc:Localization Key=Settings_Language}"
|
||||
Height="315" Width="500"
|
||||
MinHeight="300" MinWidth="450"
|
||||
ResizeMode="CanResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="White">
|
||||
|
||||
<!-- 主容器,带边距 | Main container with margins -->
|
||||
<Grid Margin="24,16,24,16">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题 | Title -->
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{loc:Localization Key=Settings_Language}"
|
||||
FontSize="18"
|
||||
FontWeight="SemiBold"
|
||||
Margin="0,0,0,8"/>
|
||||
|
||||
<!-- 副标题/描述 | Subtitle/Description -->
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{loc:Localization Key=Settings_Language_Description}"
|
||||
FontSize="12"
|
||||
Foreground="#757575"
|
||||
Margin="0,0,0,20"/>
|
||||
|
||||
<!-- 直接显示下拉选择框(无卡片)| Direct ComboBox display (no card) -->
|
||||
<telerik:RadComboBox Grid.Row="2"
|
||||
ItemsSource="{Binding AvailableLanguages}"
|
||||
SelectedItem="{Binding SelectedLanguage, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Height="36"
|
||||
Margin="0,0,0,16"
|
||||
telerik:StyleManager.Theme="Crystal">
|
||||
<telerik:RadComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Margin="4,2">
|
||||
<!-- 语言标志 | Language flag -->
|
||||
<TextBlock Text="{Binding Flag}"
|
||||
Margin="0,0,8,0"
|
||||
FontSize="16"
|
||||
VerticalAlignment="Center"/>
|
||||
<!-- 语言名称 | Language name -->
|
||||
<TextBlock Text="{Binding DisplayName}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</telerik:RadComboBox.ItemTemplate>
|
||||
</telerik:RadComboBox>
|
||||
|
||||
<!-- 提示信息区域 | Notice information area -->
|
||||
<Border Grid.Row="3"
|
||||
Background="#E3F2FD"
|
||||
BorderBrush="#2196F3"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
Padding="12"
|
||||
Margin="0,0,0,16">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 信息图标 | Information icon -->
|
||||
<Path Grid.Column="0"
|
||||
Data="M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2M13,17H11V11H13V17M13,9H11V7H13V9Z"
|
||||
Fill="#2196F3"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Stretch="Uniform"
|
||||
VerticalAlignment="Top"
|
||||
Margin="0,2,12,0"/>
|
||||
|
||||
<!-- 提示文本 | Notice text -->
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding PreviewRestartNotice}"
|
||||
FontSize="12"
|
||||
FontWeight="Medium"
|
||||
Foreground="#1976D2"
|
||||
TextWrapping="Wrap"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 占位空间 | Spacer -->
|
||||
<Grid Grid.Row="4"/>
|
||||
|
||||
<!-- 底部操作区 | Bottom action area -->
|
||||
<Grid Grid.Row="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 应用按钮(绿色)| Apply button (green) -->
|
||||
<telerik:RadButton Grid.Column="1"
|
||||
Content="{Binding PreviewApplyButtonText}"
|
||||
Command="{Binding ApplyCommand}"
|
||||
Width="100"
|
||||
Height="36"
|
||||
telerik:StyleManager.Theme="Crystal">
|
||||
<telerik:RadButton.Background>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="White"/>
|
||||
<GradientStop Color="#FF77E062" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</telerik:RadButton.Background>
|
||||
</telerik:RadButton>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Windows;
|
||||
using XP.Common.Localization.ViewModels;
|
||||
|
||||
namespace XP.Common.Localization.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// LanguageSwitcherWindow.xaml 的交互逻辑 | Interaction logic for LanguageSwitcherWindow.xaml
|
||||
/// </summary>
|
||||
public partial class LanguageSwitcherWindow : Window
|
||||
{
|
||||
public LanguageSwitcherWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数(带 ViewModel)| Constructor (with ViewModel)
|
||||
/// </summary>
|
||||
/// <param name="viewModel">语言切换器 ViewModel | Language switcher ViewModel</param>
|
||||
public LanguageSwitcherWindow(LanguageSwitcherViewModel viewModel) : this()
|
||||
{
|
||||
DataContext = viewModel;
|
||||
|
||||
if (Application.Current?.MainWindow != null)
|
||||
Icon = Application.Current.MainWindow.Icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user