MainWindow.xaml 7.8 KB

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