123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <UserControl x:Class="GDNXFD.Alert.Config.Views.DIList"
- 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:control="clr-namespace:GDNXFD.Alert.Config.Controls"
- xmlns:converts="clr-namespace:GDNXFD.Alert.Config.Converters"
- mc:Ignorable="d"
- d:DesignHeight="666" d:DesignWidth="1024" >
- <UserControl.Resources>
- <converts:LevelIdToTextConverter x:Key="levelConverter" />
- <converts:StationIdToTextConverter x:Key="stationConverter" />
- <converts:Category2ToTextConverter x:Key="categoryConverter" />
- <CollectionViewSource x:Key="statusViewSource" />
- <CollectionViewSource x:Key="rankViewSource" />
- <CollectionViewSource x:Key="stationViewSource" />
- <!-- 分页样式 -->
- <Style x:Key="PageButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="bdr_main" Background="Transparent">
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="FontSize" Value="15"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Width" Value="30"/>
- <Setter Property="FontSize" Value="15"/>
- <Setter Property="FontWeight" Value="Bold"/>
- <Setter Property="Foreground" Value="Black"/>
- </Style>
- <Style x:Key="NextPageButtonStyle" TargetType="Button" BasedOn="{StaticResource PageButtonStyle}">
- <Setter Property="Content" Value=">"/>
- </Style>
- <Style x:Key="PreviousPageButtonStyle" TargetType="Button" BasedOn="{StaticResource PageButtonStyle}">
- <Setter Property="Content" Value="<"/>
- </Style>
- <Style x:Key="FirstPageButtonStyle" TargetType="Button" BasedOn="{StaticResource PageButtonStyle}">
- <Setter Property="Content" Value="|<"/>
- <Setter Property="Width" Value="25"/>
- </Style>
- <Style x:Key="LastPageButtonStyle" TargetType="Button" BasedOn="{StaticResource PageButtonStyle}">
- <Setter Property="Content" Value=">|"/>
- <Setter Property="Width" Value="25"/>
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="24px"></RowDefinition>
- <RowDefinition Height="*"></RowDefinition>
- <RowDefinition Height="50px"></RowDefinition>
- </Grid.RowDefinitions>
- <Grid Grid.Row="0" Background="#DDDDDD">
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" >
- <TextBlock Text="场站:" Margin="15 5 0 0" />
- <ComboBox x:Name="cmbStation" VerticalAlignment="Center" Margin="0,0,0,0"
- Width="130" Background="White"
- SelectionChanged="cmbStation_SelectionChanged">
- <ComboBoxItem Tag="MHS_FDC">麻黄山风电场</ComboBoxItem>
- <ComboBoxItem Tag="NSS_FDC">牛首山风电场</ComboBoxItem>
- <ComboBoxItem Tag="QS_FDC">青山风电场</ComboBoxItem>
- <ComboBoxItem Tag="SBQ_FDC">石板泉风电场</ComboBoxItem>
- <ComboBoxItem Tag="XS_FDC">香山风电场</ComboBoxItem>
- <ComboBoxItem Tag="DWK_GDC">大武口光伏电站</ComboBoxItem>
- <ComboBoxItem Tag="PL_GDC">平罗光伏电站</ComboBoxItem>
- <ComboBoxItem Tag="MCH_GDC">马场湖光伏电站</ComboBoxItem>
- <ComboBoxItem Tag="XH_GDC">宣和光伏电站</ComboBoxItem>
- <ComboBoxItem Selector.IsSelected="True" x:Name="stationAllItem" >全部</ComboBoxItem>
- </ComboBox>
- <TextBlock Text="级别:" Margin="15 5 0 0" />
- <ComboBox x:Name="cmbRank" VerticalAlignment="Center" Margin="0,0,0,0"
- Width="80" SelectionChanged="cmbRank_SelectionChanged">
- <ComboBoxItem Tag="LOLO">低</ComboBoxItem>
- <ComboBoxItem Tag="LO">中低</ComboBoxItem>
- <ComboBoxItem Tag="MEDIUM">中</ComboBoxItem>
- <ComboBoxItem Tag="HI">中高</ComboBoxItem>
- <ComboBoxItem Tag="HIHI">高</ComboBoxItem>
- <ComboBoxItem Selector.IsSelected="True" x:Name="rankAllItem" >全部</ComboBoxItem>
- </ComboBox>
- <TextBlock Text="类型:" Margin="15 5 0 0" />
- <ComboBox x:Name="cmbCategory" VerticalAlignment="Center" Margin="0,0,0,0"
- Width="80" SelectionChanged="cmbCategory_SelectionChanged" >
- <ComboBoxItem Tag="GF">光伏</ComboBoxItem>
- <ComboBoxItem Tag="SYZ">升压站</ComboBoxItem>
- <ComboBoxItem Selector.IsSelected="True" x:Name="category1AllItem" Tag="" >全部</ComboBoxItem>
- </ComboBox>
- <TextBlock Text="状态:" Margin="15 5 0 0" />
- <ComboBox x:Name="cmbConfirmStatus" VerticalAlignment="Center" Margin="0,0,0,0"
- Width="80" SelectionChanged="cmbConfirmStatus_SelectionChanged" >
- <ComboBoxItem Selector.IsSelected="True" x:Name="statusAllItem" >全部</ComboBoxItem>
- <ComboBoxItem Tag="0" x:Name="itemUnconfirmed">未启用</ComboBoxItem>
- <ComboBoxItem Tag="1">启用</ComboBoxItem>
- </ComboBox>
- <TextBlock Text="关键字:" Margin="15 5 0 0" />
- <control:TextBoxKeyboard Grid.Column="5" MaxLength="50" Margin="0 0 0 0"
- Style="{StaticResource TextBox}"
- x:Name="txtFilter" Text="" Width="160"
- TextChanged="txtFilter_TextChanged">
- </control:TextBoxKeyboard>
- <!--刷新按钮-->
- <Button Style="{StaticResource PrimaryColorButtonStyle}" Margin="15 0 0 0"
- x:Name="btnRefresh" Click="btnRefresh_Click">
- <Image Stretch="Uniform" Margin="0" Source="/Resources/Images/query.png"></Image>
- </Button>
- <Button Style="{StaticResource PrimaryColorButtonStyle}" Margin="5 0 0 0"
- x:Name="btnNew" Click="btnNew_Click">
- <Image Stretch="Uniform" Margin="0" Source="/Resources/Images/new.png" ></Image>
- </Button>
- </StackPanel>
- </Grid>
- <DataGrid Grid.Row="1" x:Name="dgDIList"
- CanUserAddRows="False" AutoGenerateColumns="False"
- RowDetailsVisibilityMode="VisibleWhenSelected"
- SelectionMode="Extended" SelectionUnit="Cell"
- SelectedCellsChanged="dgDIList_SelectedCellsChanged"
- RowEditEnding="dgDIList_RowEditEnding"
- VerticalGridLinesBrush="{DynamicResource {x:Static SystemColors.InactiveBorderBrushKey}}" >
- <DataGrid.HorizontalGridLinesBrush>
- <SolidColorBrush Color="#FFF4F7FC"/>
- </DataGrid.HorizontalGridLinesBrush>
- <DataGrid.ColumnHeaderStyle>
- <Style TargetType="DataGridColumnHeader">
- <Setter Property="HorizontalContentAlignment" Value="Center">
- </Setter>
- </Style>
- </DataGrid.ColumnHeaderStyle>
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="场站" Width="*" >
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Path=StationName, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" VerticalAlignment="Center" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- <DataGridTemplateColumn.CellEditingTemplate>
- <DataTemplate>
- <Grid FocusManager.FocusedElement="{Binding ElementName= stationCombo}" >
- <ComboBox x:Name="stationCombo" HorizontalAlignment="Center" VerticalAlignment="Center"
- ItemsSource="{Binding Source={StaticResource stationViewSource}}"
- SelectedItem ="{Binding Path=StationName,UpdateSourceTrigger=PropertyChanged}" IsSynchronizedWithCurrentItem="False"/>
- </Grid>
- </DataTemplate>
- </DataGridTemplateColumn.CellEditingTemplate>
- </DataGridTemplateColumn>
-
- <DataGridTextColumn Header="测点名称" Width="*" Binding="{Binding PointKey}"
- IsReadOnly="True"
- ElementStyle="{StaticResource DataGridCellCenterStyle}" />
- <DataGridTextColumn Header="测点描述" Width="3*"
- ElementStyle="{StaticResource DataGridCellCenterStyle}"
- Binding="{Binding Description,UpdateSourceTrigger=PropertyChanged}"/>
- <DataGridTemplateColumn Header="级别" Width="100" >
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Path=Rank, UpdateSourceTrigger=PropertyChanged}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- <DataGridTemplateColumn.CellEditingTemplate>
- <DataTemplate>
- <Grid FocusManager.FocusedElement="{Binding ElementName= rankCombo}" >
- <ComboBox x:Name="rankCombo"
- ItemsSource="{Binding Source={StaticResource rankViewSource}}"
- SelectedItem ="{Binding Path=Rank,UpdateSourceTrigger=PropertyChanged}" IsSynchronizedWithCurrentItem="False"/>
- </Grid>
- </DataTemplate>
- </DataGridTemplateColumn.CellEditingTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn x:Name="taskColumnFaster" Header="类型" Width="100" >
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Path=Category, UpdateSourceTrigger=PropertyChanged}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- <DataGridTemplateColumn.CellEditingTemplate>
- <DataTemplate>
- <Grid FocusManager.FocusedElement="{Binding ElementName= taskCombo}" >
- <ComboBox x:Name="taskCombo"
- ItemsSource="{Binding Source={StaticResource statusViewSource}}"
- SelectedItem ="{Binding Path=Category,UpdateSourceTrigger=PropertyChanged}" IsSynchronizedWithCurrentItem="False"/>
- </Grid>
- </DataTemplate>
- </DataGridTemplateColumn.CellEditingTemplate>
- </DataGridTemplateColumn>
- <DataGridCheckBoxColumn Header="状态" Width="80" IsReadOnly="True"
- ElementStyle="{StaticResource CheckBoxCellCenterStyle}"
- Binding="{Binding Enabled, UpdateSourceTrigger=PropertyChanged}">
- <DataGridCheckBoxColumn.CellStyle>
- <Style>
- <EventSetter Event="CheckBox.Checked" Handler="chkChanged" />
- <EventSetter Event="CheckBox.Unchecked" Handler="chkChanged" />
- </Style>
- </DataGridCheckBoxColumn.CellStyle>
- </DataGridCheckBoxColumn>
- </DataGrid.Columns>
- </DataGrid>
- <!--分页-->
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" >
- <Button Style="{StaticResource FirstPageButtonStyle}" ToolTip="首页"
- Click="FirstPage_Click" />
- <Button Style="{StaticResource PreviousPageButtonStyle}" ToolTip="上一页"
- Click="PrePage_Click" />
- <ItemsControl x:Name="icPages" Background="#FFDFE0E0"
- ItemTemplate="{StaticResource ListPagesTemplate}"
- ItemsPanel="{StaticResource HorizontalItemsPanel}"
- Padding="0,0,0,0" >
- </ItemsControl>
- <Button Grid.Row="2" Style="{StaticResource NextPageButtonStyle}" ToolTip="下一页"
- Click="NextPage_Click"/>
- <Button Style="{StaticResource LastPageButtonStyle}" ToolTip="尾页"
- Click="LastPage_Click" />
- </StackPanel>
- </Grid>
- </UserControl>
|