123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <Window x:Class="BlankApp1.Views.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:convt="clr-namespace:PLCTool.Controls.Convert"
- xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
- xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
- Title="MainWindow"
- prism:ViewModelLocator.AutoWireViewModel="True"
- Height="600"
- Width="800"
- WindowStartupLocation="CenterScreen"
- MouseMove="Window_MouseMove"
- AllowsTransparency="True"
- WindowStyle="None">
- <Window.Style>
- <Style TargetType="Window">
- <Setter Property="BorderBrush" Value="#C5C5C5"/>
- <Setter Property="BorderThickness" Value="1"/>
- </Style>
- </Window.Style>
- <Window.Resources>
- <Style TargetType="TextBlock" x:Key="txtHeadStyle">
- <Setter Property="FontSize" Value="14"/>
- <Setter Property="Foreground" Value="Black"/>
- <Setter Property="Height" Value="20"/>
- <Setter Property="Width" Value="28"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="HorizontalAlignment" Value="Left"/>
- <Setter Property="Opacity" Value="55"/>
- </Style>
- <Style TargetType="Button" x:Key="IconButtonStyle">
- <Setter Property="Height" Value="20"/>
- <Setter Property="Foreground" Value="Black"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Cursor" Value="Hand"/>
- <Setter Property="Width" Value="30"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border Background="{TemplateBinding Background}">
- <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- Margin="{TemplateBinding Padding}"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#22FFFFFF"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style TargetType="RadioButton" x:Key="NavTabButtonStyle">
- <Setter Property="FontSize" Value="15"/>
- <Setter Property="Foreground" Value="#DDD"/>
- <Setter Property="Padding" Value="10,5"/>
- <Setter Property="Margin" Value="5,0"/>
- <Setter Property="Background" Value="#96a5e1"/>
- <Setter Property="Width" Value="120"/>
- <Setter Property="Command" Value="{Binding ButtonNavigateCommand}"/>
- <Setter Property="Template" >
- <Setter.Value>
- <ControlTemplate TargetType="RadioButton">
- <Border Background="{TemplateBinding Background}" CornerRadius="5,5,5,5">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="{TemplateBinding Tag}" FontFamily="../Assets/Fonts/#iconfont"
- FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0,0,0"/>
- <ContentPresenter Grid.Column="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- Margin="{TemplateBinding Padding}"/>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="Background" Value="#008CD7"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <convt:Bool2ColorConverter x:Key="boolToColorConvert"/>
- <convt:BooleanToVisibilityConverter x:Key="BoolToVis"/>
- </Window.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="60"/>
- <RowDefinition />
- <RowDefinition Height="30"/>
- </Grid.RowDefinitions>
- <Border Grid.Row="0" BorderBrush="#CBCBCB" BorderThickness="0,0,0,1" />
- <Grid Grid.Row="0" Cursor="Hand" >
- <StackPanel Orientation="Horizontal" >
- <Image Source="../Assets/Images/Logo.png" HorizontalAlignment="Stretch" Stretch="Uniform" Height="42" Width="140" Margin="0,15,0,0" />
- <TextBlock FontSize="24" Text="PLC点位测试平台" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0,0,0" />
- </StackPanel>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin=" 0,0,14,0">
- <TextBlock x:Name="txtTime" Foreground="#ffffff" VerticalAlignment="Center" Margin="0,0,18,0"/>
- <Image Source="../Assets/Images/register.png" Height="21" Width="21"></Image>
- <TextBlock Text="admin" VerticalAlignment="Center" Margin="5,0,8,0"/>
- <TextBlock Text="|" Style="{StaticResource txtHeadStyle}" Margin="0,0,17,0" Width="2" Height=" 20"></TextBlock>
- <Button x:Name="btnMin" Content="—" Click="btnMin_Click" Style="{StaticResource IconButtonStyle}"/>
- <Button x:Name="btnMax" Click="btnMax_Click" Content="" FontFamily="../Assets/Fonts/#iconfont" Style="{StaticResource IconButtonStyle}"/>
- <Button x:Name="btnClose" Content="✕" Click="btnClose_Click" Style="{StaticResource IconButtonStyle}"/>
- </StackPanel>
- </Grid>
- <Grid Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="180"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
-
- <Border Grid.Column="1" BorderBrush="#CBCBCB" BorderThickness="1,0,0,0"></Border>
- <ContentControl Grid.Column="0" prism:RegionManager.RegionName="MenuRegion" />
- <Grid Grid.Column="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="30"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid Grid.Row="0" Background=" #F2F2F2">
- <wpfdev:BreadCrumbBar ItemsSource="{Binding Path}" VerticalAlignment="Center" DisplayMemberPath="Name" Margin="0,0"
- SelectedItem="{Binding SelectedCrumb, Mode=TwoWay}">
- <b:Interaction.Triggers>
- <b:EventTrigger EventName="SelectionChanged">
- <b:InvokeCommandAction Command="{Binding BreadChangedCommand}"/>
- </b:EventTrigger>
- </b:Interaction.Triggers>
- </wpfdev:BreadCrumbBar>
- </Grid>
- <ContentControl Grid.Row="1" prism:RegionManager.RegionName="ContentRegion" />
- </Grid>
-
- </Grid>
- <Border Grid.Row="2" BorderThickness="0,1,0,0" BorderBrush="#CBCBCB">
- <StackPanel Orientation="Horizontal" >
- <TextBlock Text="状态:" Style="{StaticResource txtHeadStyle}" Width="36" Margin="12,0,12,0"/>
- <!--圆型-->
- <Path Stroke="Transparent" Fill="#11D71B" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" >
- <Path.Data >
- <EllipseGeometry Center="2,5" RadiusX="4" RadiusY="4" >
- </EllipseGeometry>
- </Path.Data>
- </Path>
- <TextBlock Text="PLC连接:" Style="{StaticResource txtHeadStyle}" Width="60" Margin="30,0,12,0"/>
- <!--圆型-->
- <Path Stroke="Transparent" Fill="{Binding PLCIsConnect ,Converter={StaticResource boolToColorConvert}}" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" >
- <Path.Data >
- <EllipseGeometry Center="2,5" RadiusX="4" RadiusY="4" >
- </EllipseGeometry>
- </Path.Data>
- </Path>
- <TextBlock Text="V2.1" Style="{StaticResource txtHeadStyle}" Width="60" Margin="30,0,12,0"/>
- </StackPanel>
- </Border>
- <!--蒙版-->
- <Grid Grid.RowSpan="3" Background="#20000000" Visibility="{Binding IsMaskVisible, Converter={StaticResource BoolToVis}}"/>
- </Grid>
- </Window>
|