从Windows应用商店应用中的不同页面向主页添加项目?

时间:2013-06-25 03:39:48

标签: c# xaml visual-studio-2012 windows-8 windows-store-apps

我想将page1.xaml中的项目添加到homepage.xaml,我创建了这个类

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; }
        }


    }

这是我在页面上选择项目时的按钮代码

private void Button_Tapped_1(object sender, TappedRoutedEventArgs e)
        {

            AllActors m = new AllActors();



            m.allActors.Add((ActorsObject)itemGridView.SelectedItem);


        }

但它没有添加任何东西,我的主页仍然是空的......

我的问题是我应该如何在homepage.xaml.cs中实现数据源代码才能使其正常工作?

0 个答案:

没有答案