|
- <UserControl
- x:Class="BPASmartClient.JXJFoodSmallStation.View.ManualCommView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
- d:DesignHeight="850"
- d:DesignWidth="1200"
- mc:Ignorable="d">
-
- <UserControl.DataContext>
- <vm:ManualCommViewModel />
- </UserControl.DataContext>
-
- <UserControl.Resources>
- <Style x:Key="radioButtonStyle" TargetType="RadioButton">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RadioButton">
- <Grid Name="gr" Opacity="0.8">
- <ContentControl
- Margin="{TemplateBinding Margin}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Content="{TemplateBinding Content}"
- FontSize="{TemplateBinding FontSize}"
- Foreground="{TemplateBinding Foreground}" />
- <Image
- Name="image"
- Source="/BPASmartClient.CustomResource;component/Image/边框线.png"
- Stretch="Fill" />
-
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="False">
- <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/边框线.png" />
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/透明背景.png" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="gr" Property="Opacity" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
-
- <Grid Margin="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <!--#region 表格标题栏设置-->
- <Grid
- Grid.Row="0"
- Margin="0,10,0,0"
- Background="#ff0C255F">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1*" />
- <ColumnDefinition Width="3*" />
- <ColumnDefinition Width="4*" />
- <ColumnDefinition Width="2*" />
- <ColumnDefinition Width="2*" />
- <ColumnDefinition Width="2*" />
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="Aqua"
- Text="序号" />
- <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
- </Grid>
- <TextBlock
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="Aqua"
- Text="地址" />
- <Grid Grid.Column="2">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="Aqua"
- Text="描述" />
- <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
- </Grid>
- <TextBlock
- Grid.Column="3"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="Aqua"
- Text="当前值" />
- <Grid Grid.Column="4">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="Aqua"
- Text="设定值" />
- <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
- </Grid>
- <TextBlock
- Grid.Column="5"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="Aqua"
- Text="功能操作" />
- <Border Grid.ColumnSpan="10" BorderThickness="1,0,1,0" />
- </Grid>
- <Grid Grid.Row="1">
- <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
- <ItemsControl Foreground="Aqua" ItemsSource="{Binding PlcInfo}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid Name="gr">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1*" />
- <ColumnDefinition Width="3*" />
- <ColumnDefinition Width="4*" />
- <ColumnDefinition Width="2*" />
- <ColumnDefinition Width="2*" />
- <ColumnDefinition Width="2*" />
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{Binding SerialNum}" />
- <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
- </Grid>
- <TextBlock
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{Binding Address}" />
-
- <Grid Grid.Column="2">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{Binding Describe}" />
- <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="3"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{Binding NowValue}" />
- <Grid Grid.Column="4">
- <TextBox Text="{Binding SetValue}" />
- <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
- </Grid>
- <Grid Grid.Column="5">
- <pry:IcoButton
- Grid.Column="0"
- Margin="40,5,40,5"
- Command="{Binding DataContext.SetParCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
- CommandParameter="{Binding Address}"
- Content="设置"
- FontSize="20"
- Foreground="Aqua"
- Style="{StaticResource IcoButtonStyle}" />
- <Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
- </Grid>
-
- <Border Grid.ColumnSpan="10" BorderThickness="1,0,1,1" />
-
- </Grid>
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
- </Trigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </Grid>
- </UserControl>
|