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 8537697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:57:44+00:00 2026-06-11T10:57:44+00:00

I used the MsDesktop Stack example here to create my pattern and establish a

  • 0

I used the MsDesktop Stack example here to create my pattern and establish a view/viewmodel/repository for an entity set, whose PrimaryKey (called PartNumber) maps to many Attribute properties of ComplexType using a Stored Procedure Function Mapping.

I was easily able to subscribe to the RaisePropertyChangedEvent(“Parts”) to populate a listbox, but am unable to get:

    public Part SelectedPart
    {
        get { return p_SelectedPart; }

        set
        {
            base.RaisePropertyChangingEvent("SelectedPart");
            p_SelectedPart = value;
            base.RaisePropertyChangedEvent("SelectedPart");
        }
    }

when I subscribe to it in my OnPropertyChangedEvent:

 void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
    {
        switch (e.PropertyName)
        {
            case "SelectedPart":

                /* When we select a Part, we need to configure the view model
                    * to display the selected Part's attributes. */

                VMSProcServices.ReturnExtendedPartProperties(this);

                break;

            case "Parts":

                /* When we load a Parts collection from the data store, we replace 
                    * the existing collection in the Parts property. After we do that, 
                    * we need to subscribe to the CollectionChanging event of the new
                    * collection. */

                this.Parts.CollectionChanging += OnPartsCollectionChanging;
                break;
        }

where ReturnExtendedProperties() is defined as:

 public static void ReturnExtendedPartProperties(MainWindowVM mainWindowVM)
 {
      MyEntities myEntities = new MyEntities();
      mainWindow.ReturnAttsPerPn_Result = new ObservableCollection<ReturnAttsPerPn_Result>();
      if (mainWindowVM.SelectedPart != null)
      {
          mainwWindowVm.ReturnAttsPerPn_Result.Clear();
          foreach (ReturnAttsPerPn_Result attResult in myEntities.ReturnAttsPerPn(mainWindowVM.SelectedPart.PnID))
          { 
              mainWindowVM.ReturnAttsPerPn_Result.Add(attResult);
          }
       }
  }

When debugging this, there is no data in my Locals window for the SelectedPart property, but the ObservableCollection of Part objects is there (which is obvious because I can see this data). Also, I never even step into the case of “SelectedPart”, only “Part” on my OnPropertyChanged Method.

My main question is, (and excuse my lack of articulation as I am a beginner): How do I effectively “catch” the value of the SelectedPart property and feed it to my Stored Procedure, and use the output as a collection?

Thanks for reading, any help greatly appreciated 🙂

Edit:: Changed Title

  • 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-06-11T10:57:45+00:00Added an answer on June 11, 2026 at 10:57 am

    Embarrassingly found my mistake, which was just a syntax error in the binding path that I didn’t catch (and is not posted. For anyone who is interested, this is a cleaner version of stored procedure results acquiring method that may be of some use to someone:

     public static void ReturnExtendedPartProperties(MainWindowVM mainWindowVM)
      {
           mainWindow.ReturnAttsPerPn_Result = new ObservableCollection<ReturnAttsPerPn_Result>();
           using (var myEntities = new MyEntities())
           {
                 var results = myEntities.ReturnAttsPerPn(mainWindowVM.SelectedPart.PnID)
                 if (mainWindowVM.SelectedPart != null)
                 {
                      mainWindowVM.ReturnAttsPerPn_Result.Clear();
                      foreach (ReturnAttsPerPn_Result attresult in results)
                      {
                            mainWindowVM.ReturnAttsPerPn_Result.Add(attresult);
                      }
                  } 
           }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used the phonegap website to create an IPA file. Now I want to
Used the create unit tests tool in Visual Studio and obviously it tries to
I used Attach method to update my Database name=New Name; checkBox1=false; Entity entity= new
I used vs2010 to create a project that uses framework 2.0. I can't use
I used MyBatis Generator 1.3.1 to create a Mapper.xml file. When MyBatis parses the
I used the LINQ to SQL designer in Visual Studio to create an object
I used jQuery to set hover callbacks for elements on my page. I'm now
I used Putty Key Generator to create a private key, called Putty-Private.ppk . I
I used zWeatherFeed to show weather, but I cant find any example to change
Used to be quite happy with the Ctrl + Shift + F10 shortcut in

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.