【发布时间】:2012-01-25 13:56:30
【问题描述】:
我有这些课程:
public class MovieExt
{
public string Title { get; set; }
public string Year { get; set; }
public List<string> Genres { get; set; }
public List<Actor> Actors { get; set; }
....
}
public class Actor
{
public string Name { get; set; }
public string Birth { get; set; }
public string Biography { get; set; }
public string Url { get; set; }
}
这是我在我的页面中的方法:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
object obj;
if (PhoneApplicationService.Current.State.TryGetValue("movie", out obj))
{
MovieExt movie = (MovieExt)obj;
this.DataContext = movie;
this.imgPoster.Source = new BitmapImage(new Uri(movie.PosterUrl, UriKind.Absolute));
}
base.OnNavigatedTo(e);
}
在页面中我正在绑定这样的属性:
<ListBox Grid.Row="4" Grid.Column="1"
Margin="5,5,5,5"
ItemsSource="{Binding Path=Actors }"
x:Name="listStars"/>
适用于所有工作(流派和其他)。其他一切都是字符串。但是对于我想绑定列表名称的演员,点击演员后我想去 url。如何绑定演员的名称属性?谢谢
【问题讨论】:
标签: windows-phone-7 data-binding binding windows-phone-7.1