MainWindow.xaml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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.Resources>
  17. <Style TargetType="TextBlock" x:Key="txtHeadStyle">
  18. <Setter Property="FontSize" Value="14"/>
  19. <Setter Property="Foreground" Value="Black"/>
  20. <Setter Property="Height" Value="20"/>
  21. <Setter Property="Width" Value="28"/>
  22. <Setter Property="VerticalAlignment" Value="Center"/>
  23. <Setter Property="HorizontalAlignment" Value="Left"/>
  24. <Setter Property="Opacity" Value="55"/>
  25. </Style>
  26. <Style TargetType="Button" x:Key="IconButtonStyle">
  27. <Setter Property="Height" Value="20"/>
  28. <Setter Property="Foreground" Value="Black"/>
  29. <Setter Property="BorderThickness" Value="0"/>
  30. <Setter Property="Background" Value="Transparent"/>
  31. <Setter Property="Cursor" Value="Hand"/>
  32. <Setter Property="Width" Value="30"/>
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="Button">
  36. <Border Background="{TemplateBinding Background}">
  37. <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  38. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  39. Margin="{TemplateBinding Padding}"/>
  40. </Border>
  41. </ControlTemplate>
  42. </Setter.Value>
  43. </Setter>
  44. <Style.Triggers>
  45. <Trigger Property="IsMouseOver" Value="True">
  46. <Setter Property="Background" Value="#22FFFFFF"/>
  47. </Trigger>
  48. </Style.Triggers>
  49. </Style>
  50. <Style TargetType="RadioButton" x:Key="NavTabButtonStyle">
  51. <Setter Property="FontSize" Value="15"/>
  52. <Setter Property="Foreground" Value="#DDD"/>
  53. <Setter Property="Padding" Value="10,5"/>
  54. <Setter Property="Margin" Value="5,0"/>
  55. <Setter Property="Background" Value="#96a5e1"/>
  56. <Setter Property="Width" Value="120"/>
  57. <Setter Property="Command" Value="{Binding ButtonNavigateCommand}"/>
  58. <Setter Property="Template" >
  59. <Setter.Value>
  60. <ControlTemplate TargetType="RadioButton">
  61. <Border Background="{TemplateBinding Background}" CornerRadius="5,5,5,5">
  62. <Grid>
  63. <Grid.ColumnDefinitions>
  64. <ColumnDefinition Width="auto"/>
  65. <ColumnDefinition/>
  66. </Grid.ColumnDefinitions>
  67. <TextBlock Text="{TemplateBinding Tag}" FontFamily="../Assets/Fonts/#iconfont"
  68. FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0,0,0"/>
  69. <ContentPresenter Grid.Column="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  70. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  71. Margin="{TemplateBinding Padding}"/>
  72. </Grid>
  73. </Border>
  74. </ControlTemplate>
  75. </Setter.Value>
  76. </Setter>
  77. <Style.Triggers>
  78. <Trigger Property="IsChecked" Value="True">
  79. <Setter Property="Foreground" Value="White"/>
  80. <Setter Property="Background" Value="#008CD7"/>
  81. </Trigger>
  82. </Style.Triggers>
  83. </Style>
  84. <convt:Bool2ColorConverter x:Key="boolToColorConvert"/>
  85. </Window.Resources>
  86. <Grid>
  87. <Grid.RowDefinitions>
  88. <RowDefinition Height="50"/>
  89. <RowDefinition />
  90. <RowDefinition Height="30"/>
  91. </Grid.RowDefinitions>
  92. <Border Grid.Row="0" BorderBrush="#CBCBCB" BorderThickness="0,0,0,1" />
  93. <Grid Grid.Row="0" Cursor="Hand" >
  94. <StackPanel Orientation="Horizontal" Margin="15,5,0,2">
  95. <Image Source="../Assets/Images/Logo.png" Height="42" Width="auto"/>
  96. <TextBlock FontSize="26" Text="PLC测试平台" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0,0,0" />
  97. </StackPanel>
  98. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin=" 0,0,14,0">
  99. <TextBlock x:Name="txtTime" Foreground="#ffffff" VerticalAlignment="Center" Margin="0,0,18,0"/>
  100. <Image Source="../Assets/Images/register.png" Height="21" Width="21"></Image>
  101. <TextBlock Text="admin" VerticalAlignment="Center" Margin="5,0,8,0"/>
  102. <TextBlock Text="|" Style="{StaticResource txtHeadStyle}" Margin="0,0,17,0" Width="2" Height=" 20"></TextBlock>
  103. <Button x:Name="btnMin" Content="—" Click="btnMin_Click" Style="{StaticResource IconButtonStyle}"/>
  104. <Button x:Name="btnMax" Click="btnMax_Click" Content="&#xe60d;" FontFamily="../Assets/Fonts/#iconfont" Style="{StaticResource IconButtonStyle}"/>
  105. <Button x:Name="btnClose" Content="✕" Click="btnClose_Click" Style="{StaticResource IconButtonStyle}"/>
  106. </StackPanel>
  107. </Grid>
  108. <Grid Grid.Row="1">
  109. <Grid.ColumnDefinitions>
  110. <ColumnDefinition Width="180"/>
  111. <ColumnDefinition/>
  112. </Grid.ColumnDefinitions>
  113. <StackPanel Grid.Column="0" Orientation="Vertical">
  114. <RadioButton Content="基础配置" Tag="&#xe62d;" Style="{StaticResource NavTabButtonStyle}" IsChecked="True"
  115. CommandParameter="BaseConfigView" Margin="5,10,0,10"/>
  116. <RadioButton Content="业务管理" Tag="&#xe626;" Style="{StaticResource NavTabButtonStyle}"
  117. CommandParameter="TestTwoView" Margin="5,0,0,10"/>
  118. <RadioButton Content="监控管理" Tag="&#xe600;" Style="{StaticResource NavTabButtonStyle}"
  119. Command="{Binding BackCommand}" Margin="5,0,0,10"/>
  120. <RadioButton Content="下一步" Tag="&#xe601;" Style="{StaticResource NavTabButtonStyle}"
  121. Command="{Binding NextCommand}" Margin="5,0,0,10"/>
  122. <RadioButton Content="数据查询" Tag="&#xe600;" Style="{StaticResource NavTabButtonStyle}"
  123. CommandParameter="QueryView" Margin="5,0,0,10"/>
  124. </StackPanel>
  125. <Border Grid.Column="1" BorderBrush="#CBCBCB" BorderThickness="1,0,0,0"></Border>
  126. <ContentControl Grid.Column="0" prism:RegionManager.RegionName="MenuRegion" />
  127. <Grid Grid.Column="1">
  128. <Grid.RowDefinitions>
  129. <RowDefinition Height="30"/>
  130. <RowDefinition/>
  131. </Grid.RowDefinitions>
  132. <Grid Grid.Row="0" Background=" #F2F2F2">
  133. <wpfdev:BreadCrumbBar ItemsSource="{Binding Path}" VerticalAlignment="Center" DisplayMemberPath="Name" Margin="0,0"
  134. SelectedItem="{Binding SelectedCrumb, Mode=TwoWay}">
  135. <b:Interaction.Triggers>
  136. <b:EventTrigger EventName="SelectionChanged">
  137. <b:InvokeCommandAction Command="{Binding BreadChangedCommand}"/>
  138. </b:EventTrigger>
  139. </b:Interaction.Triggers>
  140. </wpfdev:BreadCrumbBar>
  141. </Grid>
  142. <ContentControl Grid.Row="1" prism:RegionManager.RegionName="ContentRegion" />
  143. </Grid>
  144. </Grid>
  145. <Border Grid.Row="2" BorderThickness="0,1,0,0" BorderBrush="#CBCBCB">
  146. <StackPanel Orientation="Horizontal" >
  147. <TextBlock Text="状态:" Style="{StaticResource txtHeadStyle}" Width="36" Margin="12,0,12,0"/>
  148. <!--圆型-->
  149. <Path Stroke="Transparent" Fill="#11D71B" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" >
  150. <Path.Data >
  151. <EllipseGeometry Center="2,5" RadiusX="4" RadiusY="4" >
  152. </EllipseGeometry>
  153. </Path.Data>
  154. </Path>
  155. <TextBlock Text="PLC连接:" Style="{StaticResource txtHeadStyle}" Width="60" Margin="30,0,12,0"/>
  156. <!--圆型-->
  157. <Path Stroke="Transparent" Fill="{Binding PLCIsConnect ,Converter={StaticResource boolToColorConvert}}" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" >
  158. <Path.Data >
  159. <EllipseGeometry Center="2,5" RadiusX="4" RadiusY="4" >
  160. </EllipseGeometry>
  161. </Path.Data>
  162. </Path>
  163. <TextBlock Text="V1.3" Style="{StaticResource txtHeadStyle}" Width="60" Margin="30,0,12,0"/>
  164. </StackPanel>
  165. </Border>
  166. </Grid>
  167. </Window>