V1版本
This commit is contained in:
172
CapMachine.Wpf/Views/DialogPIDConfigView.xaml
Normal file
172
CapMachine.Wpf/Views/DialogPIDConfigView.xaml
Normal file
@@ -0,0 +1,172 @@
|
||||
<UserControl
|
||||
x:Class="CapMachine.Wpf.Views.DialogPIDConfigView"
|
||||
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.Wpf.Views"
|
||||
xmlns:localEx="clr-namespace:CapMachine.Wpf"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
Width="800"
|
||||
Height="900"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<localEx:BindingProxy x:Key="Proxy" Data="{Binding}" />
|
||||
<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" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<Button
|
||||
Margin="10,0"
|
||||
Command="{Binding AddCmd}"
|
||||
FontWeight="Bold"
|
||||
Style="{StaticResource MaterialDesignFlatLightBgButton}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="14"
|
||||
Text=" " />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="新增" />
|
||||
</StackPanel>
|
||||
|
||||
</Button>
|
||||
<Button
|
||||
Margin="10,0"
|
||||
Command="{Binding CopyCmd}"
|
||||
FontWeight="Bold"
|
||||
Style="{StaticResource MaterialDesignFlatLightBgButton}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text=" 复制" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
Margin="10,0"
|
||||
Command="{Binding DeleteCmd}"
|
||||
FontWeight="Bold"
|
||||
Style="{StaticResource MaterialDesignFlatLightBgButton}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text=" 删除" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="26"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding CurMeterName}" />
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<DataGrid
|
||||
x:Name="MainDatagrid"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
HeadersVisibility="Column"
|
||||
ItemsSource="{Binding ConfigPIDDtoItems}"
|
||||
SelectionMode="Extended"
|
||||
SelectionUnit="FullRow">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding MeterName}"
|
||||
Header="名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding IndexNo}"
|
||||
Header="PIDNo"
|
||||
IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" />
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding P}"
|
||||
Header="PID-P"
|
||||
IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" />
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding I}"
|
||||
Header="PID-I"
|
||||
IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" />
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding D}"
|
||||
Header="PID-D"
|
||||
IsReadOnly="{Binding Source={StaticResource Proxy}, Path=Data.IsComplete}" />
|
||||
</DataGrid.Columns>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<prism:InvokeCommandAction Command="{Binding GridSelectionChangedCmd}" CommandParameter="{Binding ElementName=MainDatagrid, Path=SelectedItem}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Margin="10,0,200,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="26"
|
||||
Foreground="Black"
|
||||
Text="{Binding CurSelectedItem.IndexNo}" />
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
|
||||
<Button
|
||||
Margin="10,10"
|
||||
Command="{Binding SaveCmd}"
|
||||
Content="确定"
|
||||
Foreground="White" />
|
||||
<Button
|
||||
Margin="10,10"
|
||||
Command="{Binding CancelCmd}"
|
||||
Content="取消"
|
||||
Foreground="White" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
Reference in New Issue
Block a user