123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <UserControl x:Class="GDNXFD.Alert.Config.Views.RuleList"
- 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"
- mc:Ignorable="d"
- d:DesignHeight="666" d:DesignWidth="1024" >
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="24px"></RowDefinition>
- <RowDefinition Height="*"></RowDefinition>
- <RowDefinition Height="50px"></RowDefinition>
- </Grid.RowDefinitions>
- <Grid Grid.Row="0" Background="#DDDDDD">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="80"></ColumnDefinition>
- <ColumnDefinition Width="80"></ColumnDefinition>
- <ColumnDefinition Width="60"></ColumnDefinition>
- <ColumnDefinition Width="100"></ColumnDefinition>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="200"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <!--新建规则按钮-->
- <Button Grid.Column="0" Style="{StaticResource PrimaryColorButtonStyle}"
- Command="{Binding AddRuleCommand }">
- <Image Stretch="Uniform" Margin="0" Source="/Resources/Images/new.png" ></Image>
- </Button>
- <!--刷新按钮-->
- <Button Grid.Column="1" Style="{StaticResource PrimaryColorButtonStyle}"
- Command="{Binding RefreshRuleListCommand}">
- <Image Stretch="Uniform" Margin="0" Source="/Resources/Images/refresh.png"></Image>
- </Button>
- <!--规则总数-->
- <TextBlock Height="20" Grid.Column="2" Style="{StaticResource HugeTextPrimaryColor}" Text="{Binding RulesCount, FallbackValue=0}"></TextBlock>
- <TextBlock Grid.Column="3" Style="{StaticResource RightTextPrimaryColor}">
- <Run Text="条配置规则"></Run>
- </TextBlock>
- <!--规则列表检索条件-->
- <control:TextBoxKeyboard Grid.Column="5" MaxLength="50" Margin="0 0 0 0"
- Style="{StaticResource TextBox}"
- Text="{Binding Filter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- Template="{DynamicResource SearchTextBoxTemplate}">
- </control:TextBoxKeyboard>
- </Grid>
- <DataGrid Grid.Row="1" ItemsSource="{Binding RuleList}" CanUserAddRows="False" AutoGenerateColumns="False"
- VerticalGridLinesBrush="{DynamicResource {x:Static SystemColors.InactiveBorderBrushKey}}" IsReadOnly="True" >
- <DataGrid.HorizontalGridLinesBrush>
- <SolidColorBrush Color="#FFF4F7FC"/>
- </DataGrid.HorizontalGridLinesBrush>
- <DataGrid.ColumnHeaderStyle>
- <Style TargetType="DataGridColumnHeader">
- <Setter Property="HorizontalContentAlignment" Value="Center">
- </Setter>
- </Style>
- </DataGrid.ColumnHeaderStyle>
- <DataGrid.Columns>
- <DataGridTextColumn Header="编码" Width="120" ElementStyle="{StaticResource DataGridCellCenterStyle}"
- Binding="{Binding Id}" />
- <DataGridTextColumn Header="名称" Width="*" Binding="{Binding Name}"/>
- <DataGridTextColumn Header="表达式" Width="1.5*"
- Binding="{Binding Expression}"/>
- <DataGridTextColumn Header="级别" Width="60" ElementStyle="{StaticResource DataGridCellCenterStyle}"
- Binding="{Binding Rank, Converter={StaticResource RankCodeToTextConverter}}" />
- <DataGridTextColumn Header="类型" Width="60" ElementStyle="{StaticResource DataGridCellCenterStyle}"
- Binding="{Binding Category, Converter={StaticResource CategoryCodeToTextConverter}}"/>
- <DataGridTextColumn Header="描述" Width="*"
- Binding="{Binding Description}"/>
- <DataGridTextColumn Header="标签" Width="50" Visibility="Hidden"
- Binding="{Binding Tag}"/>
- <DataGridCheckBoxColumn Header="状态" Width="60" IsReadOnly="True"
- Binding="{Binding Enabled}"/>
- <!--<DataGridTextColumn Header="范围" Width="*"
- Binding="{Binding Range}"/>-->
- <DataGridTemplateColumn Header="操作" Width="80">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <Button CommandParameter="{Binding}" Margin="0,0,5,0"
- ToolTip="{Binding Edit, Source={StaticResource Provider}, Mode=OneWay}"
- Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.EditRuleCommand }"
- Style="{StaticResource TransparentButtonStyle}">
- <Button.Content>
- <Image Source="/Resources/Images/edit.png" Width="21" Height="21"></Image>
- </Button.Content>
- </Button>
- <Button CommandParameter="{Binding}"
- Style="{StaticResource TransparentButtonStyle}" Margin="0,0,5,0"
- ToolTip="查看"
- Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.ViewRuleCommand}">
- <Button.Content>
- <Image Source="/Resources/Images/view.png" Width="20" Height="16"></Image>
- </Button.Content>
- </Button>
- <Button CommandParameter="{Binding Id}"
- Style="{StaticResource TransparentButtonStyle}"
- ToolTip="{Binding Remove, Source={StaticResource Provider}, Mode=OneWay}"
- Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.RemoveRuleCommand}">
- <Button.Content>
- <Image Source="/Resources/Images/delete.png" Width="18" Height="18"></Image>
- </Button.Content>
- </Button>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>
- <!--规则列表-->
- <!--<ItemsControl Grid.Row="2" ItemsSource="{Binding RuleList}" ItemTemplate="{StaticResource ListRulesTemplate}" Focusable="False"
- HorizontalContentAlignment="Stretch">
- </ItemsControl>-->
- <!--列表分页及按钮-->
- <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
- <Button Style="{StaticResource PreviousPageButtonStyle}" ToolTip="{Binding PreviousPage, Source={StaticResource Provider}, Mode=OneWay}"
- Command="{Binding PreviousPageCommand}"/>
- <ItemsControl Grid.Row="2" ItemsSource="{Binding PagesList}" Background="{StaticResource second-background-color-brush}"
- ItemTemplate="{StaticResource ListPagesTemplate}" ItemsPanel="{StaticResource HorizontalItemsPanel}"
- Padding="0,0,0,0" >
- </ItemsControl>
- <Button Grid.Row="2" Style="{StaticResource NextPageButtonStyle}" ToolTip="{Binding NextPage, Source={StaticResource Provider}, Mode=OneWay}"
- Command="{Binding NextPageCommand}"/>
- </StackPanel>
- </Grid>
- </UserControl>
|