|
- <UserControl x:Class="BPASmartClient.MorkMW.View.MonitorView"
- 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:BPASmartClient.MorkMW.View"
- xmlns:vm="clr-namespace:BPASmartClient.MorkMW.ViewModel"
- mc:Ignorable="d"
- Name="变量监控"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.DataContext>
- <vm:MonitorViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <SolidColorBrush Color="White" x:Key="TitleFontColor"/>
- <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
- </UserControl.Resources>
- <Grid Margin="10,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="30"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid Background="#dd2AB2E7">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40" />
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="ID" />
- <GridSplitter Background="White" Width="2" />
- <TextBlock
-
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="变量名" />
- <GridSplitter Background="White" Width="2" Grid.Column="1"/>
- <TextBlock
- Grid.Column="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="机器人地址" />
- <GridSplitter Background="White" Width="2" Grid.Column="2"/>
- <TextBlock
- Grid.Column="3"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="Modbus地址" />
- <GridSplitter Background="White" Width="2" Grid.Column="3"/>
- <TextBlock
- Grid.Column="4"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="注释" />
- <GridSplitter Background="White" Width="2" Grid.Column="4"/>
- <TextBlock
- Grid.Column="5"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="当前值" />
- <GridSplitter Background="White" Width="2" Grid.Column="5"/>
- </Grid>
- <ItemsControl ItemsSource="{Binding vars}" Grid.Row="1">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel/>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40" />
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="{Binding Id}"
- Height="30"
- Margin="0,5"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"/>
- <TextBlock Text="{Binding VaribleName}" Grid.Column="1"
- Height="30"
- Margin="0,5"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"/>
- <TextBlock Text="{Binding RobotAddress}" Grid.Column="2" HorizontalAlignment="Center"
- Height="30"
- Margin="0,5"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"/>
- <TextBlock Text="{Binding ModbusAddress}" Grid.Column="3" HorizontalAlignment="Center"
- Height="30"
- Margin="0,5"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"/>
- <TextBlock Text="{Binding Notes}" Grid.Column="4" HorizontalAlignment="Center"
- Height="30"
- Margin="0,5"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"/>
- <TextBlock Text="{Binding CurrentValue}" Grid.Column="5" HorizontalAlignment="Center"
- Height="30"
- Margin="0,5"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"/>
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>
- </UserControl>
|