我需要将所选项目添加到此集合中。我在页面上选择我的项目,然后出现 appbar,我希望在 appbar 按钮点击事件上将项目添加到将显示在另一页上的集合中。
private void Button_Tapped_1(object sender, TappedRoutedEventArgs e)
{
AllActors m = new AllActors();
ActorsObject objkt = itemGridView.SelectedItem;
m.allActors.Add(objkt);
}
这不起作用......这是我的课程:
public class AllActors : LivingDataCommon
{
public AllActors()
: base(String.Empty, String.Empty)
{
}
public AllActors(String ID, String title)
: base(ID, title)
{ }
private ObservableCollection<ActorsObject> _AllActors = new ObservableCollection<ActorsObject>();
public ObservableCollection<ActorsObject> allActors
{
get { return this._AllActors; }
}
}