이런 일에 대해 어떻게 :
<ListBox x:Name="MainListBox">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="{Binding Path=Caption}" HorizontalAlignment="Center" />
<ListBox Grid.Row="1" ItemsSource="{Binding Path=ThresholdList}" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
</StackPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="{Binding Path=Caption}" HorizontalAlignment="Center" />
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Label Content="{Binding Path=Value1}" />
<Label Content="{Binding Path=Value2}" />
<Label Content="{Binding Path=Value3}" />
<Label Content="{Binding Path=Value4}" />
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
당신은에 값 1, 값 속성을 변환해야 할 수도 있습니다 0이 아닌 값을 동적으로 표시하고 임계 값을 표시하는 데 사용한 동일한 ListBox/StackPanel 방식을 사용하기위한 컬렉션입니다.
이
출력 제공 :
그리고 바로 게시물을 완료하기를, 여기 내가 사용하는 코드입니다 :
List<Measures> measuresList = new List<Measures>();
Measures measures = new Measures()
{
Caption = "LEVEL 0",
ThresholdList = new List<Threshold>()
};
measures.ThresholdList.Add(new Threshold()
{
Caption = "Level 1a",
Value1 = 1,
Value2 = 2,
Value3 = 3,
Value4 = 4
});
measures.ThresholdList.Add(new Threshold()
{
Caption = "Level 1b",
Value1 = 5,
Value2 = 6,
Value3 = 7,
Value4 = 8
});
measuresList.Add(measures);
this.MainListBox.ItemsSource = measuresList;
여러 개의 Gridviewrowheader 프레젠터를 스태킹하는 것은 어떻습니까? 좋은 방법 일 수 있니? 나는이 문제에 갇혀있다 ... – michele
개체 모델/데이터가 어떻게 보이는지 더 잘 이해할 수 있습니까? – RQDQ
@RQDQ 표시 할 objectmodel을 추가했습니다. – michele