0
템플릿을 사용하여 확인란을 표시하는 ListView가 있습니다. MapName 속성에 데이터 바인딩하는 방법을 알아낼 수 없습니다. 어떤 도움이라도 대단히 감사하겠습니다. 확인란이 선택되어 있으면 ListView를 정렬 할 수 있습니까?양식화 된 Listview를 특정 필드에 어떻게 데이터 바인딩합니까?
<Window.Resources>
<ControlTemplate x:Key="ItemTemplate" TargetType="ListViewItem">
<Border
BorderThickness="{TemplateBinding Border.BorderThickness}"
Padding="{TemplateBinding Control.Padding}"
BorderBrush="{TemplateBinding Border.BorderBrush}"
Background="{TemplateBinding Panel.Background}"
SnapsToDevicePixels="True"
>
<ContentPresenter
Content="{TemplateBinding ContentControl.Content}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"
/>
</Border>
</ControlTemplate>
<Style TargetType="ListViewItem">
<Setter Property="Template" Value="{StaticResource ItemTemplate}" />
</Style>
<DataTemplate x:Key="ItemDataTemplate">
<CheckBox
x:Name="checkbox"
Content="{Binding}"
IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}, Path=IsSelected}"
Foreground="{DynamicResource WhiteToLightGrayFlatBrush}"
/>
</DataTemplate>
</Window.Resources>
<Border Grid.Row="7" BorderThickness="0,1,0,0" Margin="0,0,0,0" Padding="1,3,3,3"
BorderBrush="{DynamicResource GrayBorderBrush}" >
<StackPanel Orientation="Vertical">
<Label HorizontalAlignment="Left"
Content="Selected Maps:"
Foreground="{DynamicResource WhiteToLightGrayFlatBrush}"
Style="{StaticResource LabelDefaultTransparentBkgr}" />
<ListView
x:Name="mListView"
ScrollViewer.VerticalScrollBarVisibility="Visible"
Background="Transparent"
SelectionMode="Multiple"
MinHeight="73"
MaxHeight="73"
ItemTemplate="{StaticResource ItemDataTemplate}"/>
</StackPanel>
</Border>
감사!
데이브