0
我想访问列表的内容与特定的列表show_times现在我已经得到这个显示在电影名称下面,这是我想要的,但它只是显示System.Collection变量而不是数据。列表视图手机访问系统收藏列表8.1 none silverlight
private async void listViewShowtimes_Loaded(object sender, RoutedEventArgs e)
{
popcornpk_Dal _dal = new popcornpk_Dal();
MovieDetail _showTimes = await _dal.GetMovieShowtimesAsync();
var listView = (ListView)sender;
listView.ItemsSource = _showTimes.fetch_timing.ToList();
}
现在我需要的是列表中,以便出现,我认为下面会做这一点,但它并没有
<Pivot x:Name="myPivot">
<PivotItem x:Name="pvtMoveDetails" Header="movie details" Margin="28,0,10,22.5" >
<StackPanel Height="505">
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image x:Name="moveImage" Grid.Row="0" Grid.Column="0" Source="{Binding image}" HorizontalAlignment="Left" Height="186" Width="112"/>
<TextBlock FontSize="13" x:Name="txtTtile" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="212" Foreground="White" Height="29" Text="txttitle"/>
<TextBlock Grid.Row="3" Grid.Column="0" Text="Description"></TextBlock>
<TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" FontSize="13" x:Name="txtPlot" Text="{Binding Description}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Width="371" Foreground="White" Height="247" />
</Grid>
</StackPanel>
</PivotItem>
<PivotItem x:Name="pvtShowTimes" Header="showtimes">
<ListView x:Name="listViewShowtimes" ItemsSource="{Binding}" Loaded="listViewShowtimes_Loaded">
<ListView.ItemTemplate>
<DataTemplate>
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock FontSize="13" Grid.Row="0" Grid.ColumnSpan="2" Grid.Column="0" x:Name="txtshowtime" Text="{Binding theater_name}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Width="212" Foreground="White" Height="29" />
<TextBlock FontSize="13" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="txtshow_times" Text="{Binding show_times}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Width="212" Foreground="White" Height="29" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</PivotItem>
<!-- Add more pivot items if your View calls for it -->
</Pivot>
我GetShowTimesAsync呼叫是
public async Task<MovieDetail> GetMovieShowtimesAsync()
{
string jsonresult = await WCFRESTServiceCall("GET", "movie_details");
var jarray = JsonConvert.DeserializeObject<MovieDetail>(jsonresult);
return jarray;
}
电影院名称下方
类别为
public class MovieDetails
{
public string id { get; set; }
public string name { get; set; }
public string description { get; set; }
public string image { get; set; }
public string secondry_images { get; set; }
public string actor { get; set; }
public string actoress { get; set; }
public string director { get; set; }
public string music_director { get; set; }
public string release_date { get; set; }
public string tags { get; set; }
public string age_restriction { get; set; }
public string box_office { get; set; }
public string official_site { get; set; }
public string duration { get; set; }
public string writers { get; set; }
public int imdb { get; set; }
public string status { get; set; }
public string language { get; set; }
public string created { get; set; }
public string modified { get; set; }
public string movie_category_id { get; set; }
public string slug { get; set; }
public string movie_show_time_id { get; set; }
public string theatre_movie_screen_id { get; set; }
public string videous { get; set; }
public string videos { get; set; }
public string comming_soon { get; set; }
public int avg { get; set; }
public string movie_details_url { get; set; }
}
public class FetchTiming
{
public string id { get; set; }
public string theater_name { get; set; }
public string address { get; set; }
public List<string> show_times { get; set; }
public string screen_id { get; set; }
public string title { get; set; }
}
public class MovieDetail
{
public MovieDetails movie_details { get; set; }
public List<FetchTiming> fetch_timing { get; set; }
}
理想的情况下我希望能够做的是
影院名称 电影放映于:9:30,10:30等 然后NXT电影 下一页放映时间。
由于生病给那一枪anyreason为什么我的@评论设施还没有成型这里顺便说一句,是他们无论如何获取放映时间上出现的图形在所有的顶部?像一个门票图形 – rogue39nin
工作,但我想为itemsource当我想显示FormattedShowTimes我的投标路径是什么?因为我试过并且它没有工作 –
rogue39nin
@windowsphoneexpertuk您应该使用两种解决方案之一,而不是两种。 'ItemsSource'需要一个集合,所以你不能将它绑定到'FormattedShowTimes',只能绑定到'show_times'。 –