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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:34:08+00:00 2026-06-10T21:34:08+00:00

Here is my situation. I have multiple user controls in a canvas. This canvas

  • 0

Here is my situation. I have multiple user controls in a canvas. This canvas is saved out to a xaml file using XamlWriter. As most of you know, bindings are not saved using this method, so when I use XamlReader and read the user control back in, the binding no longer exists.

For a simple test, I have been trying to re-bind a ComboBox ItemsSource loaded from a XAML file (which is what I’m having issues with inside the User Control). I have tried implementing INotifyPropertyChanged, however, my variable:

public event PropertyChangedEventHandler PropertyChanged

is always null when I try and set the ComboItemsProperty:

public ObservableCollection<string> ComboItemsProperty
{
    get { return ComboItems; } //Field
    set 
    {
        ComboItems = value;
        OnPropertyChanged("ComboItemsProperty");
    }

So, my ultimate goal is to load a xaml file and then add items to a ComboBox’s ItemsSource and then have the ComboBox update with the new items.

Am I going about this the wrong way? Could someone provide me with a simple working example of this?

EDIT:

protected void OnPropertyChanged(string propertyName)
{
    PropertyChangedEventHandler handler = PropertyChanged
    if (PropertyChanged != null)
    {
         handler(this, new PropertyChangedEventArgs(propertyName));
    }
}

I’m fairly certain it has something to do with loading the XAML and the binding no longer being set. I have tried setting the binding, but no luck.

2nd EDIT:

I think I’m 99% sure that the binding is the cause. My OnPropertyChanged works fine as long as I didn’t load the combobox from a file. I have tried setting the binding as follows:

Binding bind = new Binding();
bind.Mode = BindingMode.TwoWay;
bind.Source = this.ComboItemsProperty; //Not sure about this line.
bind.Path = new PropertyPath("ComboItemsProperty");
this.SetBiding(ComboBox.ItemsSourceProperty, bind);

Confirmed. When I bring back in a simple combobox, my attempt to bind it is not working. It must be something in the code above.

  • 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-10T21:34:10+00:00Added an answer on June 10, 2026 at 9:34 pm

    bind.Source needs to point to the object containing ComboItemsProperty, not the property itself.

    Binding bind = new Binding();
    bind.Mode = BindingMode.TwoWay;
    bind.Source = this;
    bind.Path = new PropertyPath("ComboItemsProperty");
    this.SetBiding(ComboBox.ItemsSourceProperty, bind);
    

    You can check the binding succeeded with:

     if (GetBindingExpression(ComboBox.ItemsSourceProperty).Status != BindingStatus.Active)
     { 
        //binding didn't work
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where a user is able to open multiple independent dialogs.
Here's the situation: i have a SearchPage where an user can make a complex
Here's the situation: I have a custom TextBox control that contains multiple other TextBox
Here is my situation: Situation: I have users, and I have multiple values in
okay, here's the situation: <div> <a href=.. id=..></a> //similarly multiple links </div> when user
Here's the situation: I have a website with a complex address form with multiple
Here's the situation: I have a web-based ticket application, multiple users. One problem that
Here is the situation: I have multiple clients and one host. The message format&size
Here is the situation : we have to offer a customer with a web-based
Here is my situation: I have one table that contains a list of drugs

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.