【发布时间】:2013-02-18 13:33:22
【问题描述】:
如果我将 Observable 集合放在一个单独的 .cs(类)文件中并在我的 MainPage.xaml 中使用它,我怎样才能使所有数据都存储在同一个文件中以后可以从不同的 XAML 页面中访问 Observable Collection 吗?
例如
MyClass.cs:
public ObservableCollection<String> oC = new ObservableCollection<String>();
MainPage.xaml.cs:
// add to observable collection
SecondPage.xaml.cs:
// access and use data stored in ObservableCollection
【问题讨论】:
标签: c# .net xaml windows-8 microsoft-metro