1 前台代码
<Window
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:MODEL="clr-namespace:WpfApplication2.MODEL" mc:Ignorable="d" x:Class="WinShowData" x:Name="WinShowData"
Title="查看報表" Height="700" Icon=" Images\Report.png" Width="900" WindowStartupLocation="CenterScreen" >
<Window.Resources>
<CollectionViewSource x:Key="ClstblUserAndQueryViewSource" d:DesignSource="{d:DesignInstance {x:Type MODEL:clstblUserAndQuery}, CreateList=True}"/>
<CollectionViewSource x:Key="ClstblColumnGroupViewSource" d:DesignSource="{d:DesignInstance {x:Type MODEL:clstblColumnGroup}, CreateList=True}"/>
<CollectionViewSource x:Key="ClstblShopListViewSource" d:DesignSource="{d:DesignInstance {x:Type MODEL:clstblShopList}, CreateList=True}"/>
</Window.Resources>
<Grid DataContext="{StaticResource ClstblUserAndQueryViewSource}" >
<Viewbox Margin="10,10,-10,10" >
<Canvas Width="912" Height="736" >
<DataGrid x:Name="myGrid" AutoGenerateColumns="False" Height="411" Canvas.Top="315" Width="902" />
<ListView x:Name="ClstblUserAndQueryListView" ItemsSource="{Binding}" SelectionMode="Single" Height="270" HorizontalAlignment="Left" Width="277" VerticalAlignment="Top" Canvas.Top="31" >
<ListView.View>
<GridView>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked ="{Binding Path=Seli}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="90" Header="列編號" DisplayMemberBinding="{Binding Path=QueryColumnID}"/>
<GridVie