sunhonglei 5 months ago
commit e8290e9358
  1. 2
      Language/en_US.xaml
  2. 11
      Model/Helper/MultilingualHelper.cs
  3. 6
      Views/Dialog/MessageBox.xaml
  4. 12
      Views/Dialog/MessageBox.xaml.cs

@ -149,7 +149,7 @@
<sys:String x:Key="ViewportSelectPath">Select Path</sys:String>
<!-- Login Page -->
<sys:String x:Key="LoginWindowTitle">Starshine Diamond Detection System</sys:String>
<sys:String x:Key="LoginWindowTitle">Spark Diamond Detection System</sys:String>
<sys:String x:Key="LoginWindowAccount">Account</sys:String>
<sys:String x:Key="LoginWindowPassword">Password</sys:String>
<sys:String x:Key="LoginWindowRemember">Remember Password</sys:String>

@ -24,6 +24,17 @@ public class MultilingualHelper
return (string)result;
}
/// <summary>
/// 获取多语言字符
/// </summary>
/// <param name="key">KEY</param>
/// <returns>文字</returns>
/// <exception cref="NullReferenceException"></exception>
public static string getLangType()
{
return ConfigHelper.Instance.Lang.ToString();
}
/// <summary>
/// 设置语言
/// </summary>

@ -37,7 +37,7 @@
<Image Style="{StaticResource CloseHoverImageStyle}" Width="30" Height="30" />
</Button>
<TextBlock Grid.Row="1" Width="600" TextWrapping = "Wrap" Padding="30 0" HorizontalAlignment="Center"
<TextBlock Grid.Row="1" Width="600" TextWrapping = "Wrap" Padding="30 0" HorizontalAlignment="Center" SizeChanged="TextBlockCenterBox_OnSizeChanged"
VerticalAlignment="Center" TextAlignment="Center" FontSize="18" x:Name="TextBlockCenterBox" Margin="0 20"
/>
<Border Grid.Row="2" Width="500" Height="40" CornerRadius="20" BorderBrush="#ebeef5"
@ -56,7 +56,7 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button x:Name="ConfirmButton" Grid.Column="1" Padding="0" Margin="0" Height="50" Click="ConfirmButton_OnClick"
<Button x:Name="ConfirmButton" Grid.Column="1" Padding="0" Margin="0 0 0 20" Height="50" Click="ConfirmButton_OnClick"
BorderThickness="0" Background="Transparent" FocusVisualStyle="{x:Null}">
<Border
HorizontalAlignment="Center"
@ -75,7 +75,7 @@
<TextBlock FontSize="18" x:Name="ConfirmButtonText" TextAlignment="Center" Foreground="#ffffff"></TextBlock>
</Border>
</Button>
<Button x:Name="CancelButton" Grid.Column="3" Padding="0" Margin="0" Height="50" Click="CancelButton_OnClick"
<Button x:Name="CancelButton" Grid.Column="3" Padding="0" Margin="0 0 0 20" Height="50" Click="CancelButton_OnClick"
BorderThickness="0" Background="Transparent" FocusVisualStyle="{x:Null}">
<Border
HorizontalAlignment="Center"

@ -124,4 +124,16 @@ public partial class MessageBox : Window
_result = MessageBoxResult.Cancel;
this.Close();
}
private void TextBlockCenterBox_OnSizeChanged(object sender, SizeChangedEventArgs e)
{
double singleLineHeight = TextBlockCenterBox.FontSize * 1.4;
if (TextBlockCenterBox.ActualHeight > singleLineHeight)
{
// 发生换行
this.Height += 40;
}
}
}
Loading…
Cancel
Save