Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在visual studio 2013中为windows phone 8应用程序制作幻灯片?_C#_Visual Studio_Windows Phone 8 - Fatal编程技术网

C# 如何在visual studio 2013中为windows phone 8应用程序制作幻灯片?

C# 如何在visual studio 2013中为windows phone 8应用程序制作幻灯片?,c#,visual-studio,windows-phone-8,C#,Visual Studio,Windows Phone 8,我是Windows Phone开发人员的新手。我想用C#中的滑动手势对图像进行幻灯片演示,但我不能。。。该开发应用程序适用于visual studio 2013中的Win8 有人知道一个好的教程或一些例子来做这件事吗? 干杯 我认为您正在寻找的控件是FlipView 它可以在Windows 8.1和Windows phone 8.1上运行 使用它非常简单,请在XAML中添加: // SelectionChanged event will be fired every time a picture

我是Windows Phone开发人员的新手。我想用C#中的滑动手势对图像进行幻灯片演示,但我不能。。。该开发应用程序适用于visual studio 2013中的Win8

有人知道一个好的教程或一些例子来做这件事吗?
干杯

我认为您正在寻找的控件是FlipView

它可以在Windows 8.1和Windows phone 8.1上运行

使用它非常简单,请在XAML中添加:

// SelectionChanged event will be fired every time a picture changes (optional)
<FlipView x:Name="flipView1" SelectionChanged="FlipView_SelectionChanged">
    // Of course replace the source with the relative paths 
    // of the pictures you want to show
    <Image Source="Assets/Logo.png" />
    <Image Source="Assets/SplashScreen.png" />
    <Image Source="Assets/SmallLogo.png" />
</FlipView>
<FlipView x:Name="Diaporama"
          ItemsSource="{Binding FlipViewImage}">
     <FlipView.ItemTemplate>
          <DataTemplate>
              <Image Source="{Binding}"
                     Stretch="Fill" />
          </DataTemplate>
     </FlipView.ItemTemplate>
</FlipView>
//每次图片更改时都会触发SelectionChanged事件(可选)
//当然,用相对路径替换源
//您要显示的图片的列表
这是FlipView控件的简单用法,但与往常一样,最好使用绑定和MVVM设计模式,以防您正在使用它。这里是您应该编写的内容

在您的XAML中:

// SelectionChanged event will be fired every time a picture changes (optional)
<FlipView x:Name="flipView1" SelectionChanged="FlipView_SelectionChanged">
    // Of course replace the source with the relative paths 
    // of the pictures you want to show
    <Image Source="Assets/Logo.png" />
    <Image Source="Assets/SplashScreen.png" />
    <Image Source="Assets/SmallLogo.png" />
</FlipView>
<FlipView x:Name="Diaporama"
          ItemsSource="{Binding FlipViewImage}">
     <FlipView.ItemTemplate>
          <DataTemplate>
              <Image Source="{Binding}"
                     Stretch="Fill" />
          </DataTemplate>
     </FlipView.ItemTemplate>
</FlipView>

在我的ViewModel中:

// I binded the FlipView with FlipViewImage
// which is a list of strings (each string being a path)
private List<string> _flipViewImage;

public List<string> FlipViewImage
{
   get { return _flipViewImage; }
   set
   {
      _flipViewImage = value;
      NotifyPropertyChanged("FlipViewImage");
   }
}

// Then I fill the list
FlipViewImage = new List<string>
{
   // Again replace the image paths with your own
   "../Assets/Seel_photo_Aurelien.png",
   "../Assets/shop_woman.jpg",
   "../Assets/Poster.jpg"
};
//我将FlipView与FlipViewImage绑定
//这是一个字符串列表(每个字符串都是一个路径)
私有列表_flipViewImage;
公共列表FlipViewImage
{
获取{return\u flipViewImage;}
设置
{
_flipViewImage=值;
NotifyPropertyChanged(“FlipViewImage”);
}
}
//然后我填写清单
FlipViewImage=新列表
{
//再次用您自己的路径替换图像路径
“./Assets/Seel_photo_aurelian.png”,
“./Assets/shop_woman.jpg”,
“./Assets/Poster.jpg”
};
现在,您可以通过滑动手势更改图片的幻灯片

我只是展示了你可以用它做的基本东西,你可以在MSDN网站或谷歌上找到更多


Google,关于这个问题应该有足够的信息mmm不,如果有足够的信息,我就不会在这里问这个问题(我认为这有点明显)@PhixinEquis你看过了吗?@PhixinEquis另外,你需要在实际问题中包括你所做的研究。你以前做过任何研究,这并不明显。虽然您不是新用户,但我建议您查看一下该页面。@PhixinEquis您是指
Pivot
还是
WP
Panorama
控件?这是我正在寻找的,但我找不到FlipView控件,并向我显示一个标记错误(“FlipView”名称在命名空间“”中不存在)因为这根本不存在。。。你知道怎么加吗?