스택 패널이 포함 된 목록보기가 있습니다. 데이터 격자가 들어 있습니다.ListView에서 ListItem을 축소했습니다.
사용자가 확인란을 클릭하면됩니다. 과 일부 데이터가 접히게됩니다.
<Style x:Key="ShowHideStyle" TargetType="StackPanel" >
<Style.Setters>
<Setter Property="Visibility" Value="Collapsed" />
</Style.Setters>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Value="True">
<Condition.Binding>
<MultiBinding Converter="{StaticResource V_converter }">
<Binding Path="Type"></Binding>
<Binding Path="NodeID"></Binding>
<Binding Path="TLV"></Binding>
</MultiBinding>
</Condition.Binding>
</Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Visibility" Value="Visible" />
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</Style>
<ListView x:Name="LV" ItemsSource= "{Binding Lggv}" SelectionChanged="dataGridData_SelectionChanged" ItemContainerStyle="{StaticResource ListViewItemStyle}">
<ListView.ItemTemplate>
<DataTemplate x:Name="DT" >
<StackPanel x:Name="LVSP" DataContextChanged="LVSP_DataContextChanged" SourceUpdated="LVSP_SourceUpdated" Style="{StaticResource ShowHideStyle}">
<Border BorderThickness="1" BorderBrush="Black" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"></ColumnDefinition>
<ColumnDefinition Width="55"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock x:Name="tbHeader" Text="{Binding Info }" AllowDrop="True" FontWeight="Bold" Grid.Column="2" Visibility="{Binding Visibility_Header}" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Background">
<Setter.Value>
<!-- this is the default background-->
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFCEE6C6" Offset="0.008"/>
<GradientStop Color="#FF9ECF8C" Offset="0.987"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Border>
<Grid x:Name="GridData">
<Grid.Background>
<MultiBinding Converter="{StaticResource converter }">
<Binding Path="Type"></Binding>
<Binding Path="NodeID"></Binding>
<Binding Path="TLV"></Binding>
</MultiBinding>
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"></ColumnDefinition>
<ColumnDefinition Width="55"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderThickness="1" BorderBrush="Black">
<TextBlock Text="{Binding DateTime}" ></TextBlock>
</Border>
<Border Grid.Column="1" BorderThickness="1" BorderBrush="Black">
<TextBlock Text="{Binding ComPort}"></TextBlock>
</Border>
<Border Grid.Column="2" BorderThickness="1" BorderBrush="Black">
<TextBlock Text="{Binding Data}" ></TextBlock>
</Border>
</Grid>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
헤더를 항상 표시 하시겠습니까? – mm8
격자보기의 머리글 또는 목록보기의 머리글 –
StackPanel에서 "머리글"테두리를 참조하고있었습니다. – mm8