Browse Source

多语言

master
sc 1 year ago
parent
commit
0a58ce41ae
  1. 3
      App.config
  2. 2
      App.xaml.cs
  3. 32
      MainWindow.xaml

3
App.config

@ -3,7 +3,4 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<appSettings>
<add key="language" value="en-US"/>
</appSettings>
</configuration>

2
App.xaml.cs

@ -20,6 +20,8 @@ namespace DyeingComputer
{
this.Startup += new StartupEventHandler(App_Startup);
this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
//DyeingComputer.Properties.Resources.Culture = new System.Globalization.CultureInfo("en-US");//设定语言
}
System.Threading.Mutex mutex;
void App_Startup(object sender, StartupEventArgs e) //程序只允许启动一次

32
MainWindow.xaml

@ -36,12 +36,12 @@
Text="{TemplateBinding Tag}"
FontFamily="Fonts/#FontAwesome"
HorizontalAlignment="Left"
Width="40" FontSize="30" Margin="10,10,0,0"/>
Width="30" FontSize="20" Margin="5,10,0,0"/>
<TextBlock Grid.Row="0" Grid.Column="1"
Text="{TemplateBinding Content}"
FontFamily="Fonts/#FontAwesome"
HorizontalAlignment="Left"
Width="NaN" FontSize="30" Margin="50,10,0,0"/>
Width="NaN" FontSize="20" Margin="40,10,0,0"/>
</Grid>
</Border>
</Grid>
@ -60,24 +60,24 @@
</Window.Resources>
<Grid VerticalAlignment="Bottom">
<Rectangle Margin="0,0,0,0" Fill="#FFCCCCCC" VerticalAlignment="Bottom" Height="50"/>
<RadioButton Content="{x:Static lang:Resources.WorkOrder}" x:Name="Work_Order" Tag="&#xF2d2;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.TechnologicalProcess}" x:Name="Technological_Process" Tag="&#xF036;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="200,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.CurveDiagram}" x:Name="Curve_Diagram" Tag="&#xF1fe;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="400,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.EquipmentSimulation}" x:Name="Equipment_Simulation" Tag="&#xF1b3;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="600,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.HistoryRecords}" x:Name="History_Records" Tag="&#xF15C;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="800,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.Next}" x:Name="Next" Tag="&#xF061;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Right" Height="50" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_toolbar" GroupName="toolbar"/>
<Rectangle Margin="0,0,0,0" Fill="#FFCCCCCC" VerticalAlignment="Bottom" Height="40"/>
<RadioButton Content="{x:Static lang:Resources.WorkOrder}" x:Name="Work_Order" Tag="&#xF2d2;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.TechnologicalProcess}" x:Name="Technological_Process" Tag="&#xF036;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="200,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.CurveDiagram}" x:Name="Curve_Diagram" Tag="&#xF1fe;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.EquipmentSimulation}" x:Name="Equipment_Simulation" Tag="&#xF1b3;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="600,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.HistoryRecords}" x:Name="History_Records" Tag="&#xF15C;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="800,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page"/>
<RadioButton Content="{x:Static lang:Resources.Next}" x:Name="Next" Tag="&#xF061;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Right" Height="40" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_toolbar" GroupName="toolbar"/>
<RadioButton Content="{x:Static lang:Resources.InOut}" x:Name="In_Out" Tag="&#xF065;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.SysSet}" x:Name="Sys_Set" Tag="&#xF2a2;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="200,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.ParameterSet}" x:Name="Parameter_Set" Tag="&#xF013;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="400,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.Programgroup}" x:Name="Program_group" Tag="&#xF00a;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="600,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.EngineerSet}" x:Name="Engineer_Set" Tag="&#xF0f0;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="50" Margin="800,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.Previous}" x:Name="Previous" Tag="&#xF060;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Right" Height="50" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_toolbar" GroupName="toolbar" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.InOut}" x:Name="In_Out" Tag="&#xF065;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.SysSet}" x:Name="Sys_Set" Tag="&#xF2a2;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="200,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.ParameterSet}" x:Name="Parameter_Set" Tag="&#xF013;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.Programgroup}" x:Name="Program_group" Tag="&#xF00a;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="600,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.EngineerSet}" x:Name="Engineer_Set" Tag="&#xF0f0;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Left" Height="40" Margin="800,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_Page" Visibility="Hidden"/>
<RadioButton Content="{x:Static lang:Resources.Previous}" x:Name="Previous" Tag="&#xF060;" Style="{DynamicResource RadioButtonStyle}" HorizontalAlignment="Right" Height="40" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="200" Background="#FFCCCCCC" Checked="RadioButton_toolbar" GroupName="toolbar" Visibility="Hidden"/>
<Grid Grid.Column="1">
<ContentControl x:Name="container" Margin="0,0,0,50"/>
<ContentControl x:Name="container" Margin="0,0,0,40"/>
</Grid>
</Grid>
</Window>

Loading…
Cancel
Save