C# 在C中创建二维图像库(水平+垂直)
我目前正在为一个针对Windows Phone的时尚商店应用程序进行项目。对于目录,我需要创建一个图像库,如果你垂直滚动,你会看到与同一产品相关的图像,如果你横向滚动,你会看到下一个/上一个产品 我已经开始创建一个小概念画廊,是3x3图像。一列是飞机,第二列是坦克,第三列是战舰。我使用了1个水平FlipView,其中有3个垂直FlipView作为项目 以下是XAML代码:C# 在C中创建二维图像库(水平+垂直),c#,windows-store-apps,windows-phone-8.1,flipview,C#,Windows Store Apps,Windows Phone 8.1,Flipview,我目前正在为一个针对Windows Phone的时尚商店应用程序进行项目。对于目录,我需要创建一个图像库,如果你垂直滚动,你会看到与同一产品相关的图像,如果你横向滚动,你会看到下一个/上一个产品 我已经开始创建一个小概念画廊,是3x3图像。一列是飞机,第二列是坦克,第三列是战舰。我使用了1个水平FlipView,其中有3个垂直FlipView作为项目 以下是XAML代码: <Grid Background="{ThemeResource ApplicationPageBackgroundT
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<FlipView x:Name="flipBase">
<FlipView x:Name="a">
<FlipView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</FlipView.ItemsPanel>
</FlipView>
<FlipView x:Name="b">
<FlipView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</FlipView.ItemsPanel>
</FlipView>
<FlipView x:Name="c">
<FlipView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</FlipView.ItemsPanel>
</FlipView>
</FlipView>
</Grid>
我有两个主要问题:
-有没有更好的办法?这将允许我动态添加列和项
-当检测到垂直运动时,我如何限制水平运动,反之亦然,以防止对角线运动
这是我在这里的第一篇文章。非常感谢您的回答
//PRIMEIRA COLUMNA
Image foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/plane/plane_spitfire.jpg"));
a.Items.Add(foto);
foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/plane/plane_stuka.jpg"));
a.Items.Add(foto);
foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/plane/plane_yak9.jpg"));
a.Items.Add(foto);
//SEGUNDA COLUMNA
foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/tank/tank_IS.jpg"));
b.Items.Add(foto);
foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/tank/tank_Patton.jpg"));
b.Items.Add(foto);
foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/tank/tank_Tiger.jpg"));
b.Items.Add(foto);
//TERCEIRA COLUMNA
foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/destroyer/destroyer_german.jpg"));
c.Items.Add(foto);
foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/destroyer/destroyer_russian.jpg"));
c.Items.Add(foto);
foto = new Image();
foto.Source = new BitmapImage(new Uri("ms-appx:///Assets/destroyer/destroyer_usa.jpg"));
c.Items.Add(foto);
}
}