Windows Phone 8에서 작업 중이며 ListBox에 항목이 4 개 있습니다.목록 상자 : 목록 항목 또는 각 행 높이를 동적으로 변경하십시오.
동적으로 목록 항목이나 각 행 높이를 변경하고 싶습니다.
어떻게해야합니까?
<ListBox Name="TopicListbox"
ItemTemplate="{StaticResource TitleDataTemplate}"
HorizontalAlignment="Stretch"
SelectionChanged="TopicListboxSelectionChanged"
Grid.IsSharedSizeScope="True">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
<DataTemplate x:Key="TitleDataTemplate">
<Grid MinHeight="90"
HorizontalAlignment="Stretch"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" SharedSizeGroup="A" />
</Grid.RowDefinitions>
<!-- Your template here -->
</Grid>
</DataTemplate>
공지 사항 Grid.IsSharedSizeScope="True"
과의의 추가 :
<ListBox Name="TopicListbox"
ItemTemplate="{StaticResource TitleDataTemplate}"
HorizontalAlignment="Stretch"
SelectionChanged="TopicListboxSelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
<DataTemplate x:Key="TitleDataTemplate">
<Grid MinHeight="90"
HorizontalAlignment="Stretch"
VerticalAlignment="Center">
</Grid>
</DataTemplate>
동적으로? 당신은 런타임을 의미합니다> – Sajeetharan
@Sajeetharan 예, 그렇지 않으면 어떻게 할 수 있습니까? 다른 방법이 있습니까? – Goofy
당신은 행 내부에 맞게 항목 싶어요 ListBox – Jaihind