MainWindow.xaml 7.5 KB

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