MainWindow.xaml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <Window x:Class="LampInspectionMachine.Views.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:LampInspectionMachine"
  7. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:prism="http://prismlibrary.com/"
  9. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  10. lex:LocalizeDictionary.DesignCulture="zh-CN"
  11. lex:ResxLocalizationProvider.DefaultAssembly="LampInspectionMachine"
  12. lex:ResxLocalizationProvider.DefaultDictionary="Resources"
  13. prism:ViewModelLocator.AutoWireViewModel="True"
  14. mc:Ignorable="d"
  15. WindowStyle="None"
  16. Title="{lex:Loc 灯检}"
  17. Height="450"
  18. FontWeight="Bold"
  19. FontFamily="微软雅黑"
  20. WindowState="Maximized"
  21. MouseDoubleClick="Grid_MouseDown"
  22. SizeChanged="Window_SizeChanged"
  23. Width="800">
  24. <b:Interaction.Triggers>
  25. <b:EventTrigger EventName="Loaded">
  26. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  27. </b:EventTrigger>
  28. <b:EventTrigger EventName="Closed">
  29. <b:InvokeCommandAction Command="{Binding ClosedCommand}" />
  30. </b:EventTrigger>
  31. </b:Interaction.Triggers>
  32. <WindowChrome.WindowChrome>
  33. <WindowChrome GlassFrameThickness="50"
  34. CaptionHeight="30"
  35. NonClientFrameEdges="Left,Bottom,Right"
  36. CornerRadius="20" />
  37. </WindowChrome.WindowChrome>
  38. <Window.Resources>
  39. <Style x:Key="buttonborder"
  40. TargetType="Border">
  41. <Setter Property="BorderThickness"
  42. Value="2" />
  43. <Setter Property="Background"
  44. Value="Transparent" />
  45. <Setter Property="VerticalAlignment"
  46. Value="Center" />
  47. <Setter Property="BorderBrush"
  48. Value="White" />
  49. <Setter Property="CornerRadius"
  50. Value="5" />
  51. <Setter Property="Effect">
  52. <Setter.Value>
  53. <DropShadowEffect BlurRadius="10"
  54. Direction="0"
  55. ShadowDepth="0"
  56. Color="#D4D8DD" />
  57. </Setter.Value>
  58. </Setter>
  59. </Style>
  60. </Window.Resources>
  61. <Border BorderBrush="AliceBlue"
  62. BorderThickness="2"
  63. Margin="10"
  64. CornerRadius="10">
  65. <Border.Background>
  66. <LinearGradientBrush>
  67. <GradientStop Color="#95DDFD"
  68. Offset="0" />
  69. <GradientStop Color="#97B8FF"
  70. Offset="0.4" />
  71. <GradientStop Color="#2961AC"
  72. Offset="0.9" />
  73. </LinearGradientBrush>
  74. </Border.Background>
  75. <Grid Background="White"
  76. Opacity="0.8">
  77. <Grid.RowDefinitions>
  78. <RowDefinition Height="70" />
  79. <RowDefinition />
  80. <RowDefinition Height="Auto"/>
  81. </Grid.RowDefinitions>
  82. <Grid Grid.Row="0"
  83. VerticalAlignment="Center">
  84. <StackPanel Orientation="Horizontal">
  85. <TextBlock Text="{lex:Loc 灯检}"
  86. FontSize="26"
  87. Margin="30,20,0,0"
  88. FontWeight="Bold" />
  89. </StackPanel>
  90. <StackPanel Orientation="Horizontal"
  91. VerticalAlignment="Top"
  92. Height="65"
  93. HorizontalAlignment="Right">
  94. <!--<TextBlock Text="当前时间:"
  95. FontSize="16"
  96. Margin="5,5,5,10"
  97. VerticalAlignment="Bottom" />
  98. <TextBlock Text="2025-10-30"
  99. FontSize="16"
  100. Margin="0,0,25,10"
  101. VerticalAlignment="Bottom" />-->
  102. <Border Style="{StaticResource buttonborder}">
  103. <!--<Button Content="权限登录"
  104. VerticalAlignment="Top"
  105. Command="{Binding OpenRoleLoginViewCommand}"
  106. Padding="5"
  107. BorderBrush="Transparent"
  108. FontSize="15"
  109. WindowChrome.IsHitTestVisibleInChrome="True"
  110. Background="Transparent" />-->
  111. </Border>
  112. <Border Style="{StaticResource buttonborder}">
  113. <Button Content="{lex:Loc 视觉界面}"
  114. VerticalAlignment="Top"
  115. Padding="5"
  116. BorderBrush="Transparent"
  117. FontSize="15"
  118. Command="{Binding OpenMenuViewCommand}"
  119. WindowChrome.IsHitTestVisibleInChrome="True"
  120. Background="Transparent" />
  121. </Border>
  122. <Border Style="{StaticResource buttonborder}">
  123. <Button Content="{lex:Loc 运行界面}"
  124. VerticalAlignment="Top"
  125. Padding="5"
  126. BorderBrush="Transparent"
  127. FontSize="15"
  128. Command="{Binding OpenWorkRunViewCommand}"
  129. WindowChrome.IsHitTestVisibleInChrome="True"
  130. Background="Transparent" />
  131. </Border>
  132. <Button Content="➖"
  133. Margin="0,10,0,0"
  134. VerticalAlignment="Top"
  135. Name="btnNormal"
  136. Click="btnNormal_Click"
  137. Width="45"
  138. FontWeight="Bold"
  139. FontSize="15"
  140. BorderThickness="0"
  141. WindowChrome.IsHitTestVisibleInChrome="True"
  142. Background="Transparent" />
  143. <Button Content="⭕"
  144. Margin="0,7,0,0"
  145. VerticalAlignment="Top"
  146. Click="btnMaximize_Click"
  147. Name="btnMaximize"
  148. Width="45"
  149. FontWeight="Bold"
  150. FontSize="20"
  151. BorderThickness="0"
  152. WindowChrome.IsHitTestVisibleInChrome="True"
  153. Background="Transparent" />
  154. <Button Content="❌"
  155. Margin="0,10,0,0"
  156. VerticalAlignment="Top"
  157. Width="45"
  158. Command="{Binding CloseViewCommand}"
  159. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"
  160. FontWeight="Bold"
  161. FontSize="15"
  162. BorderThickness="0"
  163. WindowChrome.IsHitTestVisibleInChrome="True"
  164. Background="Transparent" />
  165. </StackPanel>
  166. </Grid>
  167. <Grid Grid.Row="1">
  168. <ContentControl prism:RegionManager.RegionName="RegionContent" />
  169. </Grid>
  170. <StackPanel>
  171. <TextBlock />
  172. </StackPanel>
  173. </Grid>
  174. </Border>
  175. </Window>