MainWindow.xaml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <Window x:Class="BlankApp1.Views.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. xmlns:convt="clr-namespace:PLCTool.Controls.Convert"
  6. xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
  7. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  8. Title="MainWindow"
  9. prism:ViewModelLocator.AutoWireViewModel="True"
  10. Height="600"
  11. Width="800"
  12. WindowStartupLocation="CenterScreen"
  13. MouseMove="Window_MouseMove"
  14. AllowsTransparency="True"
  15. WindowStyle="None">
  16. <Window.Style>
  17. <Style TargetType="Window">
  18. <Setter Property="BorderBrush" Value="#C5C5C5"/>
  19. <Setter Property="BorderThickness" Value="1"/>
  20. </Style>
  21. </Window.Style>
  22. <Window.Resources>
  23. <Style TargetType="TextBlock" x:Key="txtHeadStyle">
  24. <Setter Property="FontSize" Value="14"/>
  25. <Setter Property="Foreground" Value="Black"/>
  26. <Setter Property="Height" Value="20"/>
  27. <Setter Property="Width" Value="28"/>
  28. <Setter Property="VerticalAlignment" Value="Center"/>
  29. <Setter Property="HorizontalAlignment" Value="Left"/>
  30. <Setter Property="Opacity" Value="55"/>
  31. </Style>
  32. <Style TargetType="Button" x:Key="IconButtonStyle">
  33. <Setter Property="Height" Value="20"/>
  34. <Setter Property="Foreground" Value="Black"/>
  35. <Setter Property="BorderThickness" Value="0"/>
  36. <Setter Property="Background" Value="Transparent"/>
  37. <Setter Property="Cursor" Value="Hand"/>
  38. <Setter Property="Width" Value="30"/>
  39. <Setter Property="Template">
  40. <Setter.Value>
  41. <ControlTemplate TargetType="Button">
  42. <Border Background="{TemplateBinding Background}">
  43. <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  44. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  45. Margin="{TemplateBinding Padding}"/>
  46. </Border>
  47. </ControlTemplate>
  48. </Setter.Value>
  49. </Setter>
  50. <Style.Triggers>
  51. <Trigger Property="IsMouseOver" Value="True">
  52. <Setter Property="Background" Value="#22FFFFFF"/>
  53. </Trigger>
  54. </Style.Triggers>
  55. </Style>
  56. <Style TargetType="RadioButton" x:Key="NavTabButtonStyle">
  57. <Setter Property="FontSize" Value="15"/>
  58. <Setter Property="Foreground" Value="#DDD"/>
  59. <Setter Property="Padding" Value="10,5"/>
  60. <Setter Property="Margin" Value="5,0"/>
  61. <Setter Property="Background" Value="#96a5e1"/>
  62. <Setter Property="Width" Value="120"/>
  63. <Setter Property="Command" Value="{Binding ButtonNavigateCommand}"/>
  64. <Setter Property="Template" >
  65. <Setter.Value>
  66. <ControlTemplate TargetType="RadioButton">
  67. <Border Background="{TemplateBinding Background}" CornerRadius="5,5,5,5">
  68. <Grid>
  69. <Grid.ColumnDefinitions>
  70. <ColumnDefinition Width="auto"/>
  71. <ColumnDefinition/>
  72. </Grid.ColumnDefinitions>
  73. <TextBlock Text="{TemplateBinding Tag}" FontFamily="../Assets/Fonts/#iconfont"
  74. FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0,0,0"/>
  75. <ContentPresenter Grid.Column="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  76. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  77. Margin="{TemplateBinding Padding}"/>
  78. </Grid>
  79. </Border>
  80. </ControlTemplate>
  81. </Setter.Value>
  82. </Setter>
  83. <Style.Triggers>
  84. <Trigger Property="IsChecked" Value="True">
  85. <Setter Property="Foreground" Value="White"/>
  86. <Setter Property="Background" Value="#008CD7"/>
  87. </Trigger>
  88. </Style.Triggers>
  89. </Style>
  90. <convt:Bool2ColorConverter x:Key="boolToColorConvert"/>
  91. <convt:BooleanToVisibilityConverter x:Key="BoolToVis"/>
  92. </Window.Resources>
  93. <Grid>
  94. <Grid.RowDefinitions>
  95. <RowDefinition Height="60"/>
  96. <RowDefinition />
  97. <RowDefinition Height="30"/>
  98. </Grid.RowDefinitions>
  99. <Border Grid.Row="0" BorderBrush="#CBCBCB" BorderThickness="0,0,0,1" />
  100. <Grid Grid.Row="0" Cursor="Hand" >
  101. <StackPanel Orientation="Horizontal" >
  102. <Image Source="../Assets/Images/Logo.png" HorizontalAlignment="Stretch" Stretch="Uniform" Height="42" Width="140" Margin="0,15,0,0" />
  103. <TextBlock FontSize="24" Text="PLC点位测试平台" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0,0,0" />
  104. </StackPanel>
  105. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin=" 0,0,14,0">
  106. <TextBlock x:Name="txtTime" Foreground="#ffffff" VerticalAlignment="Center" Margin="0,0,18,0"/>
  107. <Image Source="../Assets/Images/register.png" Height="21" Width="21"></Image>
  108. <TextBlock Text="admin" VerticalAlignment="Center" Margin="5,0,8,0"/>
  109. <TextBlock Text="|" Style="{StaticResource txtHeadStyle}" Margin="0,0,17,0" Width="2" Height=" 20"></TextBlock>
  110. <Button x:Name="btnMin" Content="—" Click="btnMin_Click" Style="{StaticResource IconButtonStyle}"/>
  111. <Button x:Name="btnMax" Click="btnMax_Click" Content="&#xe60d;" FontFamily="../Assets/Fonts/#iconfont" Style="{StaticResource IconButtonStyle}"/>
  112. <Button x:Name="btnClose" Content="✕" Click="btnClose_Click" Style="{StaticResource IconButtonStyle}"/>
  113. </StackPanel>
  114. </Grid>
  115. <Grid Grid.Row="1">
  116. <Grid.ColumnDefinitions>
  117. <ColumnDefinition Width="180"/>
  118. <ColumnDefinition/>
  119. </Grid.ColumnDefinitions>
  120. <Border Grid.Column="1" BorderBrush="#CBCBCB" BorderThickness="1,0,0,0"></Border>
  121. <ContentControl Grid.Column="0" prism:RegionManager.RegionName="MenuRegion" />
  122. <Grid Grid.Column="1">
  123. <Grid.RowDefinitions>
  124. <RowDefinition Height="30"/>
  125. <RowDefinition/>
  126. </Grid.RowDefinitions>
  127. <Grid Grid.Row="0" Background=" #F2F2F2">
  128. <wpfdev:BreadCrumbBar ItemsSource="{Binding Path}" VerticalAlignment="Center" DisplayMemberPath="Name" Margin="0,0"
  129. SelectedItem="{Binding SelectedCrumb, Mode=TwoWay}">
  130. <b:Interaction.Triggers>
  131. <b:EventTrigger EventName="SelectionChanged">
  132. <b:InvokeCommandAction Command="{Binding BreadChangedCommand}"/>
  133. </b:EventTrigger>
  134. </b:Interaction.Triggers>
  135. </wpfdev:BreadCrumbBar>
  136. </Grid>
  137. <ContentControl Grid.Row="1" prism:RegionManager.RegionName="ContentRegion" />
  138. </Grid>
  139. </Grid>
  140. <Border Grid.Row="2" BorderThickness="0,1,0,0" BorderBrush="#CBCBCB">
  141. <StackPanel Orientation="Horizontal" >
  142. <TextBlock Text="状态:" Style="{StaticResource txtHeadStyle}" Width="36" Margin="12,0,12,0"/>
  143. <!--圆型-->
  144. <Path Stroke="Transparent" Fill="#11D71B" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" >
  145. <Path.Data >
  146. <EllipseGeometry Center="2,5" RadiusX="4" RadiusY="4" >
  147. </EllipseGeometry>
  148. </Path.Data>
  149. </Path>
  150. <TextBlock Text="PLC连接:" Style="{StaticResource txtHeadStyle}" Width="60" Margin="30,0,12,0"/>
  151. <!--圆型-->
  152. <Path Stroke="Transparent" Fill="{Binding PLCIsConnect ,Converter={StaticResource boolToColorConvert}}" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" >
  153. <Path.Data >
  154. <EllipseGeometry Center="2,5" RadiusX="4" RadiusY="4" >
  155. </EllipseGeometry>
  156. </Path.Data>
  157. </Path>
  158. <TextBlock Text="V2.1" Style="{StaticResource txtHeadStyle}" Width="60" Margin="30,0,12,0"/>
  159. </StackPanel>
  160. </Border>
  161. <!--蒙版-->
  162. <Grid Grid.RowSpan="3" Background="#20000000" Visibility="{Binding IsMaskVisible, Converter={StaticResource BoolToVis}}"/>
  163. </Grid>
  164. </Window>