EquipmentPropMonitor.xaml 5.03 KB
<Window x:Class="HHECS.RobotTool.View.EquipmentPropView.EquipmentPropMonitor"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:HHECS.RobotTool.View.EquipmentPropView"
        xmlns:hc="https://handyorg.github.io/handycontrol"
        mc:Ignorable="d"
        xmlns:viewmodel="clr-namespace:HHECS.RobotTool.ViewModel.EquipmentPropVM"
        d:DataContext="{d:DesignInstance Type=viewmodel:EquipmentPropMonitorVM}"
        Title="属性数据" Height="450" Width="800" WindowStartupLocation="CenterScreen" Closing="Window_Closing">
    <DockPanel>
        <StackPanel DockPanel.Dock="Top">
            <hc:UniformSpacingPanel Spacing="10">
                <hc:ElementGroup VerticalAlignment="Center" Height="30" Margin="0,1" Layout="Stack">
                    <Border Style="{StaticResource BorderRegion}" Padding="6,0">
                        <TextBlock Text="属性编号" Width="50" VerticalAlignment="Center"/>
                    </Border>
                    <TextBox Text="{Binding EquipmentPropCode,UpdateSourceTrigger=PropertyChanged}" MinWidth="150"/>
                </hc:ElementGroup>
                <hc:ElementGroup VerticalAlignment="Center" Height="30" Layout="Stack">
                    <Border Style="{StaticResource BorderRegion}" Padding="6,0">
                        <TextBlock Text="属性名称" Width="50" VerticalAlignment="Center"/>
                    </Border>
                    <hc:AutoCompleteTextBox MinWidth="150" VerticalAlignment="Center" HorizontalAlignment="Center" ItemsSource="{Binding NameItems}" Text="{Binding EquipmentPropName}"/>
                </hc:ElementGroup>
                <hc:ElementGroup VerticalAlignment="Center" Height="30" Layout="Stack">
                    <Border Style="{StaticResource BorderRegion}" Padding="6,0">
                        <TextBlock Text="属性类型" Width="50" VerticalAlignment="Center"/>
                    </Border>
                    <hc:ComboBox MinWidth="150" MaxWidth="200" ItemsSource="{Binding EquipmentPropTypes}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectedValue="{Binding EquipmentPropType}" Style="{StaticResource ComboBoxExtend}" />
                </hc:ElementGroup>
            </hc:UniformSpacingPanel>
            <ToolBar Padding="4" Margin="0,1" HorizontalAlignment="Right">
                <hc:UniformSpacingPanel Spacing="5">
                    <Button Content="搜索" Command="{Binding SerachCommand}" Style="{StaticResource ButtonDefault}" hc:IconElement.Geometry="{StaticResource SearchGeometry}"/>
                </hc:UniformSpacingPanel>
            </ToolBar>
        </StackPanel>
        <hc:Pagination DockPanel.Dock="Bottom" MaxPageCount="{Binding MaxPage}" PageIndex="{Binding PageIndex}" DataCountPerPage="{Binding PageSize}" IsJumpEnabled="True">
            <hc:Interaction.Triggers>
                <hc:EventTrigger EventName="PageUpdated">
                    <hc:EventToCommand Command="{Binding PageUpdatedCommand}" PassEventArgsToCommand="True" />
                </hc:EventTrigger>
            </hc:Interaction.Triggers>
        </hc:Pagination>
        <DataGrid Style="{StaticResource DataGrid.Small}" IsReadOnly="True" hc:DataGridAttach.CanUnselectAllWithBlankArea="True" HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding EquipmentPropList}" hc:DataGridAttach.ShowRowNumber="True">
            <!--<DataGrid.RowHeaderTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
                </DataTemplate>
            </DataGrid.RowHeaderTemplate>-->
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Id}" Header="Id" Visibility="Hidden"/>
                <DataGridTextColumn Binding="{Binding EquipmentTypePropTemplateCode}" Header="属性编号"/>
                <DataGridTextColumn Binding="{Binding EquipmentTypePropTemplate.Name}" Header="属性名称"/>
                <DataGridTextColumn Binding="{Binding EquipmentTypePropTemplate.DataType}" Header="数据类型"/>
                <DataGridTextColumn Binding="{Binding Address}" Header="地址"/>
                <DataGridTextColumn Binding="{Binding Value,UpdateSourceTrigger=PropertyChanged}" Header="值"/>
                <DataGridTextColumn Binding="{Binding EquipmentTypePropTemplate.PropType}" Header="属性类型"/>
                <DataGridTextColumn Binding="{Binding Remark}" Header="描述"/>
                <DataGridTextColumn Binding="{Binding Created, StringFormat={}{0:yyyy/MM/dd HH:mm:ss}}" Header="创建时间"/>
                <DataGridTextColumn Binding="{Binding Updated,UpdateSourceTrigger=PropertyChanged, StringFormat={}{0:yyyy/MM/dd HH:mm:ss}}" Header="修改时间"/>
            </DataGrid.Columns>
        </DataGrid>
    </DockPanel>
</Window>