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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:43:57+00:00 2026-06-12T19:43:57+00:00

I am trying to set up a binding to an explicitly implemented interface property

  • 0

I am trying to set up a binding to an explicitly implemented interface property from code-behind. The reason for the code-behind binding is that the path to the bound property can only be determined at run-time.

In the XAML, it is possible to bind thusly (example in MainWindow.xaml):

<TextBox Text="{Binding (local:IViewModel.Property)}"/>

and in fact, binding in the code behind works in a similar way (from MainWindow.xaml.cs):

var binding = new Binding("(local:IViewModel.Property)");

since WPF is able to pick up the namespace mapping.

My question is, how do I form a binding like this when the namespace mapping is not present (for example, in an attached behaviour)?

Many thanks in advance!

  • 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-12T19:43:58+00:00Added an answer on June 12, 2026 at 7:43 pm

    You would specify a full PropertyPath:

    var propertyInfo = typeof(IViewModel).GetProperty("Property");
    var propertyPath = new PropertyPath("(0)", propertyInfo);
    var binding = new Binding
    {
        Path = propertyPath
    };
    

    For details on the syntax passed to PropertyPath above, see PropertyPath.Path.

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

Sidebar

Related Questions

I'm trying to set up a property binding (WPF) in code. The code compiles
I'm trying to set up a system that displays calendar items from a resource
I am trying to set twoway binding on a UserControl that I have created.
I am trying to set a javascript date so that it can be submitted
I am trying to set up the binding between Core Data, NSArraycountroller and a
I'm trying to set a TwoWay binding to a combo box using only a
I'm trying to set up a system that would allow me to attach a
I am trying to set datacontext of a control using the following code: public
I'm trying to set the ItemsSource property of a DataGrid named dgIssueSummary to be
I'm trying to set up a class so that it's possible to initialize it

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.