|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <UserControl x:Class="FryPot_DosingSystem.View.FryPotMonitorView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:FryPot_DosingSystem.View"
- xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.DataContext>
- <vm:FryPotMonitorViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <Style x:Key="dataGrid" TargetType="DataGrid" >
- <Setter Property="HorizontalGridLinesBrush" Value="#FF2AB2E7"/>
- <Setter Property="VerticalGridLinesBrush" Value="#FF2AB2E7"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="BorderBrush" Value="#FF2AB2E7"/>
- <Setter Property="CanUserResizeColumns" Value="False"/>
- <Setter Property="HeadersVisibility" Value="Column"/>
- <Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
- <Setter Property="VerticalScrollBarVisibility" Value="Hidden"/>
- </Style>
- <Style x:Key="ColumHeaderStyle" TargetType="DataGridColumnHeader">
- <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="Background" Value="#FF2AB2E7"></Setter>
- <Setter Property="Foreground" Value="White"></Setter>
- <Setter Property="BorderThickness" Value="1"></Setter>
- <Setter Property="BorderBrush" Value="White"></Setter>
- <Setter Property="Height" Value="30"/>
- <Setter Property="FontSize" Value="16"/>
- <Setter Property="FontWeight" Value="Heavy"/>
- <Setter Property="Margin" Value="-1,-1,-1,-1"/>
- </Style>
-
- <Style x:Key="rowStyle" TargetType="DataGridRow">
- <Setter Property="Height" Value="35"/>
- <Setter Property="Foreground" Value="SkyBlue"/>
- <Style.Triggers>
- <Trigger Property="AlternationIndex" Value="0">
- <Setter Property="Background" Value="Transparent" />
- </Trigger>
- <Trigger Property="AlternationIndex" Value="1">
- <Setter Property="Background" Value="Transparent" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#000066" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style x:Key="textboxStyle" TargetType="TextBox">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Foreground" Value="SkyBlue"/>
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="FontSize" Value="16"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="CaretBrush" Value="LightBlue"/>
- <Style.Triggers>
- <Trigger Property="IsFocused" Value="True">
- <Setter Property="Cursor" Value="Arrow"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style x:Key="cellStyle" TargetType="DataGridCell">
- <Style.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Foreground"
- Value="SkyBlue"/>
- </Trigger>
- <Trigger Property="IsSelected" Value="false">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Foreground"
- Value="SkyBlue"/>
- </Trigger>
-
- </Style.Triggers>
- </Style>
- <Style x:Key="dgCellstyle" TargetType="TextBlock">
- <Setter Property="HorizontalAlignment" Value="Center"></Setter>
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="FontSize" Value="16"/>
- </Style>
- </UserControl.Resources>
-
- <DataGrid Grid.Row="1" ItemsSource="{Binding variableMonitorModels}" GridLinesVisibility="All" Background="Transparent"
- AutoGenerateColumns="False" IsReadOnly="True" Style="{StaticResource dataGrid}"
- ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
- <DataGrid.Columns>
- <DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBox Text="{Binding Id}" IsReadOnly="False" Style="{StaticResource textboxStyle}"></TextBox>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTextColumn Width="0.2*" Header="变量名" Binding="{Binding VarName}" ElementStyle="{StaticResource dgCellstyle }">
- </DataGridTextColumn>
-
- <DataGridTextColumn Width="0.2*" Header="描述" Binding="{Binding Notes}" ElementStyle="{StaticResource dgCellstyle }">
- </DataGridTextColumn>
- <DataGridTextColumn Width="0.2*" Header="实时状态值" Binding="{Binding CurrentValue}" ElementStyle="{StaticResource dgCellstyle }">
- </DataGridTextColumn>
- <DataGridTextColumn Width="0.2*" Header="PLC地址" Binding="{Binding PLCAddress}" ElementStyle="{StaticResource dgCellstyle }">
- </DataGridTextColumn>
- <DataGridTextColumn Width="0.2*" Header="ModbusTcp地址" Binding="{Binding ModbusTcpAddress}" ElementStyle="{StaticResource dgCellstyle }">
- </DataGridTextColumn>
- <!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBox Text="{Binding PlcAddress}" Style="{StaticResource textboxStyle}"></TextBox>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>-->
- <!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址长度">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBox Text="{Binding Length}" Style="{StaticResource textboxStyle}"></TextBox>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>-->
- </DataGrid.Columns>
- </DataGrid>
-
-
- </UserControl>
|