【发布时间】:2016-06-24 14:50:06
【问题描述】:
我已经在 C# 上设置了我的 ListView,问题是 XAML。我当前的代码是这样工作的:
<ListView x:Name="List" ItemsSource="{Binding}" SelectionChanged="List_SelectionChanged">
<ListView.ItemTemplate>
<DataTemplate>
<Grid Margin="11" Width="460">
<StackPanel Orientation="Vertical" >
<Image Width="100" Height="100"
Source="{Binding Way}"/>
</StackPanel>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
但我想做这样的事情:
【问题讨论】:
-
您能详细说明一下吗?前 2 个框应该是列表框中的一项吗?因为你的代码因为
Source="{Binding Way}"OneWay TwoWay 而无法编译? -
@KoryGill “方式”正在绑定到我的资产文件夹的路径,每个框都是我的列表视图的一项,我尝试使用 ListBox,但我无法使用“ItemTemplate”。这个应用程序是我想要的,但在这种情况下,他可能使用 GridRows here
-
啊……这让我失望了。
-
@KoryGill 对不起?
-
我认为对于 UWP,您需要 VariableSizedWrapGrid。
标签: c# xaml uwp win-universal-app uwp-xaml