Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7196493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:47:18+00:00 2026-05-28T20:47:18+00:00

I want each pivot item to be one directory in isolated storage then load

  • 0

I want each pivot item to be one directory in isolated storage then load every file name into a listbox I find it quite confusing , can you guys help me with it?

Currently its all just showing in one pivot & for my app, user can actually create a pivot aka directory.

will it be possible to create a code in a way where i can i will load the directory based on the pivotitem name then load all item from that directory?

Thanks >.<

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





    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:47:19+00:00Added an answer on May 28, 2026 at 8:47 pm

    For creating one pivot item for each directory, its better if you can create a class for the same, name say “DirectoyItem” which has the name and a collection of file’s(call it as Files) name in that directory.

    1. For better modularity and clarity create a Viewmodel for the page which has the Collection( ObservableColelction is most preferred) of “DirectoryItem”. call this collection as Directories

      public class ViewModel
      {
      ObservableCollection Directories = new ObservableColelction();

      // call LoadFromLocalStorage() and add items to this Directories  list  
      

      }

      public class DirectoryItem:INotifyPropertyChanged
      {
      string _name;

      ObservableCollection<string> Files;
      
      public DirectoryItem()
      {
          _name = null;
          Files = new ObservableCollection<string>();
      }
      
      //write public set and get for Name field.
      
      //notify whenever property changes
      

      }

    2. Bind this collection items to the PivotControl items.
      you can do so , as follows

    set the datacontext something like this in page constructor

    public MyPage()
    {
        //Initializa components
        this.DataContext = new ViewModel();
    }
    
    1. Finally on application launch, for each directory of the IsolatedStorage create a DirectoryItem and store in the Collection of DirectoryItems(Files).

    By doing this you will create a page which has the pivot controls whose items are the directories of the Isolated storage and each pivot item has the names of the files in that particular directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using jquery and want each form text input to appear one by one,
I have an array of Image URLS .I want to dynamically add Pivot item
I have a pivot where each pivotItem contains a scrollviewer. What I want to
I want each (small) file specified with ARGV read in its own array. If
Say I have 4 buttons and I want each one to do a different
I want to have panorama control (or pivot ) that each PanoramaItem will be
I want each action taken on certain tables to be logged. I want logging
I have a DevExpress GridControl and i want each cell to be multiline. I
I have a list view with 10 columns and I want each row to
Assume I have an enum, and I want each enum value to be associated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.