Windows phone 8 windows phone 8如何像pivot或panaroma控件一样滑动本地html文件?

Windows phone 8 windows phone 8如何像pivot或panaroma控件一样滑动本地html文件?,windows-phone-8,Windows Phone 8,我是windows phone 8的初学者,实际上我已经创建了一个项目,在本地文件夹中有一些html文件(40个文件),我希望在用户水平滑动时,像pivot或panaroma控件一样逐个显示所有html文件。, 我知道如何通过使用web浏览器控件静态调用本地html文件,我在许多项目中也做过,但我不知道当用户水平滑动时如何逐个显示所有文件 我尝试在pivot项中动态添加web浏览器控件 这是我用web浏览器控件创建动态轴心项目的代码 “pivotPage.cs” 简单地说,我的要求是“如何像WP

我是windows phone 8的初学者,实际上我已经创建了一个项目,在本地文件夹中有一些html文件(40个文件),我希望在用户水平滑动时,像pivot或panaroma控件一样逐个显示所有html文件。, 我知道如何通过使用web浏览器控件静态调用本地html文件,我在许多项目中也做过,但我不知道当用户水平滑动时如何逐个显示所有文件

我尝试在pivot项中动态添加web浏览器控件

这是我用web浏览器控件创建动态轴心项目的代码

“pivotPage.cs”

简单地说,我的要求是“如何像WP8应用中的滑动视图那样逐个显示本地html文件?”


提前谢谢,我在等待一些答案。

最后我自己找到了这样的答案,它对我有效

步骤1:为了显示内容集合(html、图像、文本等),请使用数据绑定概念在xaml页面中创建如下UI

    <phone:Pivot x:Name="pivotList" Margin="0,0,0,80" ItemsSource="{Binding}" >
           <!-- <phone:Pivot.Title>
                <TextBlock Text="40 ways to lose belly fat" FontSize="28" Foreground="#FF00FFEE"></TextBlock>
            </phone:Pivot.Title>-->
            <phone:Pivot.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding _title}" Foreground="#FF00FFEE" FontSize="48"></TextBlock>
                </DataTemplate>
            </phone:Pivot.HeaderTemplate>
            <phone:Pivot.ItemTemplate>
                <DataTemplate>
                <phone:WebBrowser Name="browser" Source="{Binding _url}" Margin="20,-10,20,0">
                </phone:WebBrowser>
                </DataTemplate>
            </phone:Pivot.ItemTemplate>
        </phone:Pivot>

希望这会有所帮助。,

如果有很多html文件,并且如果有任何处理html文件的操作,比如加载完成事件,执行一些javascript执行或浏览器内容的拖动事件,执行一些操作等。在这种情况下,这种方法是否有效?
  <Grid x:Name="ContentPanel" Margin="0,0,0,0" Grid.RowSpan="2" Background="#FF378FB1">
        <phone:Pivot x:Name="pivotList" Background="White" Margin="10,130,10,80"/>
    </Grid>
  for(int i=0; i<25; i++)
  {
    string _url = "ways/a"+ i + ".html";
    PivotItem newPivotItem = new PivotItem();
    newPivotItem.Margin = new Thickness(0, -10, 0, 0);
    WebBrowser newWebBrowser = new WebBrowser();
    newWebBrowser.Navigate(new Uri(_url, UriKind.Relative));
    newPivotItem.Content = newWebBrowser;
    pivotList.Items.Add(newPivotItem);
  }
  for (int i = 0; i < 40; i++)
  {

  }
  could you please some one try to give me solution for this and also 

  tell me that is there any control for showing html files like swipe view?
    <phone:Pivot x:Name="pivotList" Margin="0,0,0,80" ItemsSource="{Binding}" >
           <!-- <phone:Pivot.Title>
                <TextBlock Text="40 ways to lose belly fat" FontSize="28" Foreground="#FF00FFEE"></TextBlock>
            </phone:Pivot.Title>-->
            <phone:Pivot.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding _title}" Foreground="#FF00FFEE" FontSize="48"></TextBlock>
                </DataTemplate>
            </phone:Pivot.HeaderTemplate>
            <phone:Pivot.ItemTemplate>
                <DataTemplate>
                <phone:WebBrowser Name="browser" Source="{Binding _url}" Margin="20,-10,20,0">
                </phone:WebBrowser>
                </DataTemplate>
            </phone:Pivot.ItemTemplate>
        </phone:Pivot>
   public partial class pivotPage : PhoneApplicationPage
{
    private List<TList> _pivotList;
    public pivotPage()
    {
        InitializeComponent();
        Loaded += pivotPage_Loaded;

    }

    void pivotPage_Loaded(object sender, RoutedEventArgs e)
    {
        _pivotList = new List<TList>();
        int j = 1;
        for (int i = 0; i < 40; i++)
        {
            _pivotList.Add(new TList 
            {
                _title="flat Belly Tip-"+j,
                _url="ways/a"+ i + ".html"
            });
            j++;
        }
        pivotList.DataContext = _pivotList;
    }
  http://stackoverflow.com/questions/14004493/databinding-dynamic-pivot