157 lines
6.9 KiB
XML
157 lines
6.9 KiB
XML
<UserControl
|
||
x:Class="CapMachine.Shared.Controls.MeterConfig"
|
||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||
xmlns:local="clr-namespace:CapMachine.Shared.Controls"
|
||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
x:Name="MeterConfigInstance"
|
||
d:DesignHeight="330"
|
||
d:DesignWidth="360"
|
||
mc:Ignorable="d">
|
||
<UserControl.Resources>
|
||
<Style x:Key="myHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
|
||
<Setter Property="FontSize" Value="24" />
|
||
<Setter Property="Width" Value="218" />
|
||
</Style>
|
||
<Style x:Key="myHeaderStyle1" TargetType="{x:Type GridViewColumnHeader}">
|
||
<Setter Property="FontSize" Value="16" />
|
||
</Style>
|
||
</UserControl.Resources>
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="30" />
|
||
<RowDefinition Height="70" />
|
||
<RowDefinition Height="40" />
|
||
<RowDefinition />
|
||
</Grid.RowDefinitions>
|
||
<StackPanel Grid.ColumnSpan="3" Margin="1">
|
||
<Border
|
||
Padding="3"
|
||
Background="LightSteelBlue"
|
||
CornerRadius="3">
|
||
<TextBlock
|
||
FontSize="18"
|
||
Foreground="Blue"
|
||
Text="{Binding ElementName=MeterConfigInstance, Path=MeterName}" />
|
||
</Border>
|
||
|
||
</StackPanel>
|
||
<Grid Grid.Row="1">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition />
|
||
<ColumnDefinition />
|
||
<ColumnDefinition />
|
||
</Grid.ColumnDefinitions>
|
||
<StackPanel Margin="5,10,0,0">
|
||
<TextBox
|
||
Height="55"
|
||
VerticalAlignment="Top"
|
||
materialDesign:HintAssist.Hint="起始速度"
|
||
AcceptsReturn="True"
|
||
FontSize="18"
|
||
Style="{StaticResource MaterialDesignOutlinedTextBox}"
|
||
Text="{Binding ElementName=MeterConfigInstance, Path=SelectedMeter.StartValue}"
|
||
TextWrapping="NoWrap"
|
||
VerticalScrollBarVisibility="Disabled" />
|
||
</StackPanel>
|
||
<StackPanel Grid.Column="1" Margin="5,10,0,0">
|
||
<TextBox
|
||
Height="55"
|
||
VerticalAlignment="Top"
|
||
materialDesign:HintAssist.Hint="结束速度"
|
||
AcceptsReturn="True"
|
||
FontSize="18"
|
||
Style="{StaticResource MaterialDesignOutlinedTextBox}"
|
||
Text="{Binding ElementName=MeterConfigInstance, Path=SelectedMeter.EndValue}"
|
||
TextWrapping="NoWrap"
|
||
VerticalScrollBarVisibility="Disabled" />
|
||
</StackPanel>
|
||
<StackPanel Grid.Column="2" Margin="5,10,0,0">
|
||
<TextBox
|
||
Height="55"
|
||
VerticalAlignment="Top"
|
||
materialDesign:HintAssist.Hint="维持时间"
|
||
AcceptsReturn="True"
|
||
FontSize="18"
|
||
Style="{StaticResource MaterialDesignOutlinedTextBox}"
|
||
Text="{Binding ElementName=MeterConfigInstance, Path=SelectedMeter.KeepTime}"
|
||
TextWrapping="NoWrap"
|
||
VerticalScrollBarVisibility="Disabled" />
|
||
</StackPanel>
|
||
</Grid>
|
||
<StackPanel Grid.Row="2" Orientation="Horizontal">
|
||
<Button
|
||
Margin="5,3"
|
||
Background="IndianRed"
|
||
Command="{Binding ElementName=MeterConfigInstance, Path=AddCommand}"
|
||
Content="增加"
|
||
Foreground="White"
|
||
Style="{StaticResource MaterialDesignRaisedSecondaryLightButton}"
|
||
ToolTip="增加程序步骤内的速度设置" />
|
||
<Button
|
||
Margin="5,3"
|
||
Background="IndianRed"
|
||
Command="{Binding ElementName=MeterConfigInstance, Path=EditCommand}"
|
||
Content="修改"
|
||
Foreground="White"
|
||
Style="{StaticResource MaterialDesignRaisedSecondaryLightButton}"
|
||
ToolTip="修改程序步骤内的速度设置,请先选中" />
|
||
<Button
|
||
Margin="5,3"
|
||
Background="IndianRed"
|
||
Command="{Binding ElementName=MeterConfigInstance, Path=DeleteCommand}"
|
||
Content="删除"
|
||
Foreground="White"
|
||
Style="{StaticResource MaterialDesignRaisedSecondaryLightButton}"
|
||
ToolTip="删除程序步骤内的速度设置,请先选中" />
|
||
</StackPanel>
|
||
<Border
|
||
Grid.Row="3"
|
||
Margin="3,0"
|
||
BorderBrush="Black"
|
||
BorderThickness="1">
|
||
<ListView
|
||
x:Name="listviewMeter"
|
||
Foreground="Black"
|
||
ItemsSource="{Binding ElementName=MeterConfigInstance, Path=ListMeter}">
|
||
<i:Interaction.Triggers>
|
||
<i:EventTrigger EventName="SelectionChanged">
|
||
<i:InvokeCommandAction Command="{Binding ElementName=MeterConfigInstance, Path=MeterSelectedChangedCmd}" CommandParameter="{Binding ElementName=listviewMeter, Path=SelectedItem}" />
|
||
</i:EventTrigger>
|
||
</i:Interaction.Triggers>
|
||
<ListView.View>
|
||
|
||
<GridView ColumnHeaderContainerStyle="{StaticResource myHeaderStyle1}">
|
||
<GridViewColumn
|
||
Width="60"
|
||
DisplayMemberBinding="{Binding StepNo}"
|
||
Header="序号" />
|
||
<GridViewColumn
|
||
Width="80"
|
||
DisplayMemberBinding="{Binding StartValue}"
|
||
Header="起始速度" />
|
||
<GridViewColumn
|
||
Width="80"
|
||
DisplayMemberBinding="{Binding EndValue}"
|
||
Header="终止速度" />
|
||
<GridViewColumn
|
||
Width="80"
|
||
DisplayMemberBinding="{Binding KeepTime}"
|
||
Header="持续时间" />
|
||
</GridView>
|
||
|
||
</ListView.View>
|
||
<!-- 设置ListViewItem的背景色,模拟网格效果 -->
|
||
<!--<ListView.ItemContainerStyle>
|
||
<Style TargetType="ListViewItem">
|
||
<Setter Property="Background" Value="LightGray" />
|
||
</Style>
|
||
</ListView.ItemContainerStyle>-->
|
||
</ListView>
|
||
</Border>
|
||
</Grid>
|
||
</UserControl>
|