我希望每个数据透视条目都是独立存储中的一个目录,然后将每个文件名称加载到一个列表框中我觉得它很混乱,你们可以帮我吗?将轴心项目作为独立存储中的目录
目前,它的所有只显示在我的应用程序的一个关键点&,用户实际上可以创建枢轴aka目录。
是否有可能创建一个代码的方式,我可以加载基于pivotitem名称的目录,然后加载该目录中的所有项目?
谢谢>。 <
public partial class View2 : PhoneApplicationPage
{
public String selected;
public View2()
{
InitializeComponent();
LoadFromLocalStorage();
}
private void LoadFromLocalStorage()
{
try
{
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
//string[] fileNames = store.GetFileNames();
string[] fileNames = store.GetFileNames("./general/*.*");
var files = new ObservableCollection<string>();
foreach (string s in fileNames)
{
files.Add(s);
}
lbFiles.ItemsSource = files;
}
}
catch
{
MessageBox.Show("Capture an image first!");
}
}
private static string _first;
public string First
{
get
{
return _first;
}
}
private void lbFiles_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
selected = lbFiles.SelectedItem.ToString();
general item = new general();
item.viewimage(selected);
MessageBox.Show(selected);
_first = selected;
NavigationService.Navigate(new Uri("/View.xaml", UriKind.Relative));
}
}
是的,这是可能的。你希望我们写代码吗? – 2012-02-01 10:30:26