328 lines
16 KiB
XML
328 lines
16 KiB
XML
<UserControl
|
|
x:Class="_29WxOrderWpf.Ctrls.ShopCtrls.ShopListCtrl"
|
|
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:local="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
x:Name="shopListCtrl"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="800"
|
|
Loaded="shopListCtrl_Loaded"
|
|
mc:Ignorable="d">
|
|
<Grid Background="{StaticResource ListCtrlBackColorBrush}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="40" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid x:Name="gridSearch">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock
|
|
Grid.Column="0"
|
|
Margin="6,0,0,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Text="店名" />
|
|
<Border
|
|
Grid.Column="1"
|
|
Height="26"
|
|
Margin="4"
|
|
BorderBrush="{StaticResource mainColorBrush}"
|
|
BorderThickness="1"
|
|
CornerRadius="4">
|
|
<TextBox
|
|
x:Name="txtShopName"
|
|
Margin="3,0"
|
|
VerticalContentAlignment="Center"
|
|
Style="{StaticResource BaseTextBoxStyle}" />
|
|
</Border>
|
|
<TextBlock
|
|
Grid.Column="2"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Text="分组" />
|
|
<Border
|
|
Grid.Column="3"
|
|
Height="26"
|
|
Margin="4"
|
|
BorderBrush="{StaticResource mainColorBrush}"
|
|
BorderThickness="1"
|
|
CornerRadius="4">
|
|
<ComboBox
|
|
x:Name="cmbGroup"
|
|
Margin="3,0"
|
|
VerticalContentAlignment="Center"
|
|
SelectionChanged="cmbGroup_SelectionChanged"
|
|
Style="{StaticResource BaseComboBoxStyle}" />
|
|
</Border>
|
|
<TextBlock
|
|
Grid.Column="4"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Text="备注" />
|
|
<Border
|
|
Grid.Column="5"
|
|
Height="26"
|
|
Margin="4"
|
|
BorderBrush="{StaticResource mainColorBrush}"
|
|
BorderThickness="1"
|
|
CornerRadius="4">
|
|
<ComboBox
|
|
x:Name="cmbNotes"
|
|
Margin="3,0"
|
|
VerticalContentAlignment="Center"
|
|
SelectionChanged="cmbNotes_SelectionChanged"
|
|
Style="{StaticResource BaseComboBoxStyle}" />
|
|
</Border>
|
|
<Button
|
|
x:Name="btnSearch"
|
|
Grid.Row="4"
|
|
Grid.Column="6"
|
|
Height="26"
|
|
Click="btnSearch_Click"
|
|
Content=" 搜索 "
|
|
Style="{StaticResource BasePageButtonStyle}" />
|
|
<Button
|
|
x:Name="btnRestore"
|
|
Grid.Row="4"
|
|
Grid.Column="7"
|
|
Height="26"
|
|
Margin="4,0,6,0"
|
|
Click="btnRestore_Click"
|
|
Content=" 还原 "
|
|
Style="{StaticResource BasePageButtonLightStyle}" />
|
|
</Grid>
|
|
<Grid
|
|
x:Name="lstTitle"
|
|
Grid.Row="1"
|
|
Margin="4,0"
|
|
Background="{StaticResource ListHeadBackColorBrush}">
|
|
<Border BorderBrush="{StaticResource ListHeadBorderColorBrush}" BorderThickness="0,0,1,0">
|
|
<DataGrid
|
|
x:Name="dgShopHeader"
|
|
Grid.ColumnSpan="100"
|
|
Margin="0,0,18,0"
|
|
AutoGenerateColumns="False"
|
|
BorderThickness="0"
|
|
CanUserReorderColumns="False"
|
|
ColumnDisplayIndexChanged="dgShopHeader_ColumnDisplayIndexChanged"
|
|
ColumnHeaderHeight="{Binding ElementName=lstTitle, Path=ActualHeight}"
|
|
LayoutUpdated="dgShopHeader_LayoutUpdated">
|
|
<DataGrid.Columns>
|
|
<DataGridTemplateColumn
|
|
x:Name="colSelectAll"
|
|
Width="50"
|
|
Header="选择"
|
|
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}">
|
|
<DataGridTemplateColumn.HeaderTemplate>
|
|
<DataTemplate>
|
|
<Grid Width="14" Height="14">
|
|
<!--<CheckBox x:Name="headerCheckBox" BorderThickness="0" IsChecked="{Binding DataContext.AreAllSelected, RelativeSource={RelativeSource AncestorType=DataGrid}, UpdateSourceTrigger=PropertyChanged}" Checked="HeaderCheckBox_Checked" Unchecked="HeaderCheckBox_Unchecked"/>-->
|
|
<CheckBox
|
|
x:Name="chkSelectAll"
|
|
BorderThickness="0"
|
|
Checked="ChkSelectAll_Checked"
|
|
IsChecked="False"
|
|
IsThreeState="True"
|
|
Loaded="ChkSelectAll_Loaded"
|
|
Unchecked="ChkSelectAll_Unchecked" />
|
|
<Border
|
|
Width="14"
|
|
Height="14"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Background="Transparent"
|
|
BorderBrush="{StaticResource mainColorBrush}"
|
|
BorderThickness="1"
|
|
IsHitTestVisible="False" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.HeaderTemplate>
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<!--<CheckBox IsChecked="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
|
|
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
<DataGridTextColumn
|
|
Width="100*"
|
|
Header="AppId"
|
|
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
|
<DataGridTextColumn
|
|
Width="100*"
|
|
Header="店铺名称"
|
|
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
|
<DataGridTextColumn
|
|
Width="100*"
|
|
Header="分组"
|
|
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
|
<DataGridTextColumn
|
|
Width="82*"
|
|
Header=" 备注"
|
|
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</Border>
|
|
</Grid>
|
|
<!--<ListBox Grid.Row="2" x:Name="lbxShop" ItemsSource="{Binding GlobalConfig.ShopLoginList}" BorderThickness="0" Margin="4,0,4,4">-->
|
|
<ListBox
|
|
x:Name="lbxShop"
|
|
Grid.Row="2"
|
|
Margin="4,0,4,4"
|
|
BorderThickness="0"
|
|
SelectionMode="Extended">
|
|
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ListBoxItem">
|
|
<ContentPresenter
|
|
Content="{TemplateBinding Content}"
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<!--<local:ShopListRowCtrl></local:ShopListRowCtrl>-->
|
|
<Border
|
|
MinHeight="50"
|
|
Margin="0,0,0,0"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
BorderBrush="{StaticResource ListRowBorderColorBrush}"
|
|
BorderThickness="0,0,0,1"
|
|
CornerRadius="0">
|
|
<Border.Style>
|
|
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
|
|
<Style TargetType="Border">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
|
|
<Grid x:Name="gridListItem">
|
|
<Grid.ColumnDefinitions>
|
|
<!--<ColumnDefinition Width="{Binding colShopIdWidth,RelativeSource={RelativeSource AncestorType={x:Type local:ShopListCtrl}}}" ></ColumnDefinition>-->
|
|
<ColumnDefinition x:Name="colCheck" Width="100*" />
|
|
<ColumnDefinition x:Name="colShopId" Width="100*" />
|
|
<ColumnDefinition x:Name="colShopName" Width="100*" />
|
|
<ColumnDefinition x:Name="colGroupName" Width="100*" />
|
|
<ColumnDefinition x:Name="colNotes" Width="100*" />
|
|
</Grid.ColumnDefinitions>
|
|
<CheckBox
|
|
Grid.Column="0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Background="Transparent"
|
|
Click="CheckBox_Click"
|
|
IsChecked="{Binding IsSelect, Mode=TwoWay}"
|
|
Tag="{Binding ShopId}" />
|
|
<TextBox
|
|
Grid.Column="1"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
IsReadOnly="True"
|
|
Tag="{Binding ShopId}"
|
|
Text="{Binding ShopId}"
|
|
TextWrapping="Wrap" />
|
|
<TextBox
|
|
Grid.Column="2"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
IsReadOnly="True"
|
|
Tag="{Binding ShopId}"
|
|
Text="{Binding ShopAccount}"
|
|
TextWrapping="Wrap" />
|
|
<TextBox
|
|
Grid.Column="3"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
IsReadOnly="True"
|
|
Tag="{Binding ShopId}"
|
|
Text="{Binding GroupName}"
|
|
TextWrapping="Wrap" />
|
|
<TextBox
|
|
Grid.Column="4"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
IsReadOnly="True"
|
|
Tag="{Binding ShopId}"
|
|
Text="{Binding Notes}"
|
|
TextWrapping="Wrap" />
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<Grid x:Name="gridRefreshOrSelect" Grid.Row="3">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Button
|
|
x:Name="btnRefreshShop"
|
|
Grid.Row="4"
|
|
Grid.Column="0"
|
|
Height="26"
|
|
Margin="6,0,0,0"
|
|
Click="btnRefreshShop_Click"
|
|
Content=" 刷新店铺 "
|
|
Style="{StaticResource BasePageButtonStyle}" />
|
|
|
|
<Button
|
|
x:Name="btnApplySelectShop"
|
|
Grid.Row="4"
|
|
Grid.Column="6"
|
|
Height="26"
|
|
Click="btnApplySelectShop_Click"
|
|
Content=" 确定 "
|
|
Style="{StaticResource BasePageButtonStyle}" />
|
|
<Button
|
|
x:Name="btnCancelSelectShop"
|
|
Grid.Row="4"
|
|
Grid.Column="7"
|
|
Height="26"
|
|
Margin="4,0,6,0"
|
|
Click="btnCancelSelectShop_Click"
|
|
Content=" 取消 "
|
|
Style="{StaticResource BasePageButtonLightStyle}" />
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|