123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- <UserControl
- x:Class="ShakerControl.View.CoolWaterView"
- 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:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerControl.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:ShakerControl.ViewModel.MainPage"
- d:DataContext="{d:DesignInstance {x:Type vm:MainPageViewModel}}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data.MainPage}"
- mc:Ignorable="d">
- <Grid IsEnabled="{Binding ShakerControl.AllowCoolingWater}">
- <Grid.RowDefinitions>
- <RowDefinition Height="1*" />
- <RowDefinition Height="1*" />
- <RowDefinition Height="1*" />
- </Grid.RowDefinitions>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="66" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock
- VerticalAlignment="Center"
- FontSize="{StaticResource ContentTitleFontSize}"
- FontWeight="Bold"
- Foreground="{StaticResource ContentTextBrush}"
- Text="显示数据" />
- <Line
- VerticalAlignment="Bottom"
- Stroke="{StaticResource ContentSplitLineBrush}"
- StrokeThickness="2"
- X1="0"
- X2="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
- Y1="0"
- Y2="0" />
- <ListView
- Grid.Row="1"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="{StaticResource TextFontSize}"
- Foreground="{StaticResource ContentTextBrush}"
- ItemsSource="{Binding ShakerControl.CoolingWaters}">
- <ListView.Style>
- <Style TargetType="ListView">
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListView}">
- <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemTemplate">
- <Setter.Value>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="120" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <TextBlock
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="{Binding Name, Mode=OneWay, StringFormat={}{0}:}"
- TextWrapping="Wrap" />
- <TextBlock
- Grid.Column="1"
- Margin="10,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center">
- <Run Text="{Binding Value, Mode=OneWay}" />
- <Run Text="{Binding Unit, Mode=OneWay}" />
- </TextBlock>
- </Grid>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style TargetType="ListViewItem">
- <Setter Property="Height" Value="42" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="IsEnabled" Value="False" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <ContentPresenter
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- ContentTemplateSelector="{x:Null}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <UniformGrid
- Margin="0"
- Columns="3"
- Style="{x:Null}" />
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ListView.Style>
- </ListView>
- </Grid>
- <Grid Grid.Row="1" IsEnabled="{Binding ShakerControl.IsConnected}">
- <Grid.RowDefinitions>
- <RowDefinition Height="66" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock
- VerticalAlignment="Center"
- FontSize="{StaticResource ContentTitleFontSize}"
- FontWeight="Bold"
- Foreground="{StaticResource ContentTextBrush}"
- Text="冷却水状态" />
- <Line
- VerticalAlignment="Bottom"
- Stroke="{StaticResource ContentSplitLineBrush}"
- StrokeThickness="2"
- X1="0"
- X2="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
- Y1="0"
- Y2="0" />
- <ListView
- Grid.Row="1"
- VerticalAlignment="Top"
- Background="Transparent"
- FontSize="{StaticResource TextFontSize}"
- Foreground="{StaticResource ContentTextBrush}"
- ItemsSource="{Binding ShakerControl.CoolingWaterGroup.Items}">
- <ListView.Style>
- <Style TargetType="ListView">
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListView}">
- <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemTemplate">
- <Setter.Value>
- <DataTemplate>
- <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="140" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.Column="0"
- VerticalAlignment="Center"
- FontSize="{StaticResource TextFontSize}"
- Foreground="{StaticResource ContentTextBrush}"
- Text="{Binding Name}"
- TextWrapping="Wrap" />
- <Ellipse
- Grid.Column="1"
- Width="36"
- Height="36"
- HorizontalAlignment="Left"
- VerticalAlignment="Center">
- <Ellipse.Style>
- <Style TargetType="Ellipse">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Value}" Value="True">
- <Setter Property="Fill" Value="Red" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Value}" Value="False">
- <Setter Property="Fill" Value="Green" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Source={StaticResource MainViewModel}, Path=Data.MainPage.ShakerControl.IsConnected}" Value="False">
- <Setter Property="Fill" Value="Gray" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Ellipse.Style>
- </Ellipse>
- </Grid>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style TargetType="ListViewItem">
- <Setter Property="Height" Value="42" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="IsEnabled" Value="False" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <ContentPresenter
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- ContentTemplateSelector="{x:Null}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <UniformGrid
- Margin="0"
- Columns="4"
- Style="{x:Null}" />
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ListView.Style>
- </ListView>
- </Grid>
- <Grid Grid.Row="2" IsEnabled="{Binding ShakerControl.IsConnected}">
- <Grid.RowDefinitions>
- <RowDefinition Height="66" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock
- VerticalAlignment="Center"
- FontSize="{StaticResource ContentTitleFontSize}"
- FontWeight="Bold"
- Foreground="{StaticResource ContentTextBrush}"
- Text="冷却水控制" />
- <Line
- VerticalAlignment="Bottom"
- Stroke="{StaticResource ContentSplitLineBrush}"
- StrokeThickness="2"
- X1="0"
- X2="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
- Y1="0"
- Y2="0" />
- <UniformGrid
- Grid.Row="1"
- VerticalAlignment="Center"
- Columns="3">
- <StackPanel>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{StaticResource TextFontSize}"
- Foreground="{StaticResource ContentTextBrush}"
- Text="启动" />
- <Button
- Width="{StaticResource PowerAmplifierButtonSize}"
- Height="{StaticResource PowerAmplifierButtonSize}"
- Margin="0,10,0,0"
- Padding="0"
- hc:IconElement.Geometry="{StaticResource PowerAmplifierStart}"
- Command="{Binding ShakerControl.CoolingWater.StartCommand}"
- Cursor="Hand"
- IsEnabled="{Binding ShakerControl.CoolingWaterStartEnabled}"
- Style="{StaticResource PowerAmplifierButtonStyle}"
- ToolTip="启动" />
- </StackPanel>
- <StackPanel>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{StaticResource TextFontSize}"
- Foreground="{StaticResource ContentTextBrush}"
- Text="停止" />
- <Button
- Width="{StaticResource PowerAmplifierButtonSize}"
- Height="{StaticResource PowerAmplifierButtonSize}"
- Margin="0,10,0,0"
- Padding="0"
- hc:IconElement.Geometry="{StaticResource PowerAmplifierStop}"
- Command="{Binding ShakerControl.CoolingWater.StopCommand}"
- Cursor="Hand"
- IsEnabled="{Binding ShakerControl.CoolingWaterStopEnabled}"
- Style="{StaticResource PowerAmplifierButtonStyle}"
- ToolTip="停止" />
- </StackPanel>
- <StackPanel>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{StaticResource TextFontSize}"
- Foreground="{StaticResource ContentTextBrush}"
- Text="报警复位" />
- <Button
- Width="{StaticResource PowerAmplifierButtonSize}"
- Height="{StaticResource PowerAmplifierButtonSize}"
- Margin="0,10,0,0"
- Padding="0"
- hc:IconElement.Geometry="{StaticResource PowerAmplifierReset}"
- Command="{Binding ShakerControl.CoolingWater.ResetCommand}"
- Cursor="Hand"
- IsEnabled="{Binding ShakerControl.CoolingWaterResetEnabled}"
- Style="{StaticResource PowerAmplifierButtonStyle}"
- ToolTip="报警复位" />
- </StackPanel>
- </UniformGrid>
- </Grid>
- </Grid>
- </UserControl>
|