此列表视图中的项目存在问题,不会跨越屏幕宽度.对不起,如果我的代码很草率.这有点新鲜.我有类似代码的类似页面.
提前致谢!
不是完整的代码 - 不确定你是否需要它.
<ListView x:Name="listView" DataContext="{Binding ServicesCvs}" ItemsSource="{Binding}" Margin="0,80,0,0" HorizontalContentAlignment="Stretch">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Button Command="{Binding DataContext.SelectServiceCommand, ElementName=serviceSelectionPage}"
CommandParameter="{Binding Text, ElementName=ServiceIdTextBlock}">
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="ServiceIdTextBlock" Grid.Column="1" FontFamily="Arial" Text="{Binding ServiceId}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" Foreground="#FF18417C" Margin="10,0,0,0"/>
<TextBlock x:Name="ServiceType" Grid.Column="2" FontFamily="Arial" Text="{Binding ServiceTypeId}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" Foreground="#FF414B59"/>
<TextBlock x:Name="AssetId_TextBlock" Grid.Column="3" FontFamily="Arial" Text="{Binding AssetId}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" Foreground="#FF4D7CC1"/>
<TextBlock x:Name="ProductItemId_TextBlock" Grid.Column="4" FontFamily="Arial" Text="{Binding …Run Code Online (Sandbox Code Playgroud)