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

  • Home
  • SEARCH
  • 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 3493930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:56:40+00:00 2026-05-18T11:56:40+00:00

Im writing a Silverlight 4 App with a TreeView and Ria Services in MVVM

  • 0

Im writing a Silverlight 4 App with a TreeView and Ria Services in MVVM to display customers hierarchically.
I dont want to load all customers from database, I want to reload them by expanding a vertex instead. Is there a chance to do this using MVVM Pattern?

Within database’s customers model, there is an “Parent_id” relationship and no “child_id”!

Thanks a lot!

  • 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-18T11:56:41+00:00Added an answer on May 18, 2026 at 11:56 am

    Yes, it is possible. But be informed that it is a comlicated task.

    At first, you should have a viewmodel with the following properties:

    • Id (used for receiving childitems by parentId)
    • Title (shown in the treeview)
    • ChildItems (real collection or blank items)
    • IsExpanded
    • IsBlank (if this item is child item and isn’t loaded yet)

    At the beginning you have a list of these models, but collection ChildTtems should consist of blank items. If childitems collection is empty – you will not be able to expand a parent item.

    Next step – bind IsExpanded property. You can find solution on this link.

        private bool isExpanded;
    
        public bool IsExpanded
        {
            get { return isExpanded; }
            set
            {
                isExpanded = value;
                OnPropertyChanged("IsExpanded");
                if(isExpanded)
                    this.UpdateChildItems();
            }
        }
    
        public ObservableCollection<HierarchyViewModel> ChildItems { get; set; }
    
        void UpdateChildItems()
        {
            //Check wheter the child items are blank (this.ChildItems.Any(ci=>ci.IsBlank))
            //and if answer is yes, receive real items from service, 
            //transform each of them to a viewmodel class and set IsBlank=false
        }
    

    Also, you have to receive a number of childitems for each item and generate collection of blank items.

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

Sidebar

Related Questions

I'm writing a Silverlight app using the MVVM pattern. I have a main view
I'm writing a silverlight app that queries a web service to populate a tree
When writing a Silverlight app hooked up to a WCF Web Service, the only
I am writing a Silverlight app calling WCF service. Another solution contains following projects
I'm writing a silverlight app which does some real-time charting. Basically, I just have
I'm writing a silverlight application that resembles a shopping cart system. This app can
I am writing a small silverlight app just to try silverlight. My idea is
I am writing a Silverlight client that interacts with an SQL database via ASP.NET
Writing some test scripts in IronPython, I want to verify whether a window is
Using Silverlight 3 to build a file upload app. It can upload files of

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.