böyle bir şey hakkında nasıl
<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>
Sen içine değer1, değer2 özelliklerini dönüştürmek gerekebilir Sıfır olmayanları dinamik olarak görüntülemek ve eşikleri görüntülemek için kullandığım aynı ListBox/StackPanel yaklaşımını kullanmak için bir koleksiyon.
Bu
çıktıyı verir:
Ve sadece yazıyı tamamlamak için, burada kullanılan kod:
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;
Birden çok gridviewrowheaderpresenter'ı istiflemeye ne dersiniz? İyi bir yol olabilir mi? Bu problemde sıkışıp kaldım ... – michele
Nesne modelinizin/verilerinizin neye benzediğini daha iyi anlayabilir miyiz? – RQDQ
@RQDQ Ben – michele