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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:48:45+00:00 2026-05-16T20:48:45+00:00

Made a much simpler example, hopefully someone can follow this and help me Here

  • 0

Made a much simpler example, hopefully someone can follow this and help me

Here is my code.

ViewModel

public class ViewModel
{
    private Person _noninterfacePerson;
    private IPerson _interfacePerson;

    public ViewModel()
    {
        _noninterfacePerson = new Person();
        _interfacePerson = new Person();
    }

    public Person NonInterfacePerson
    {
        get { return _noninterfacePerson; }
    }

    public IPerson InterfacePerson
    {
        get { return InterfacePerson; }
    }

}

Person

public class Person : IPerson
{
    public Person()
    {

    }

    public string Name
    {
        get;
        set;
    }

    public int age
    {
        get;
        set;
    }

}

IPerson

public interface IPerson
{
    int age { get; set; }
    string Name { get; set; }
}

View

<Window x:Class="WpfApplication2.MainWindow"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApplication2"
        mc:Ignorable="d"
 Title="MainWindow" Height="350" Width="525">
 <Grid d:DataContext="{d:DesignInstance local:ViewModel}">

 </Grid>
</Window>

In Expression Blend if I insert a textblock, click on the “Advanced Options” -> Data Binding… -> Data Context I see both InterfacePerson and NonInterfacePerson as options to bind to. However, NonInterfacePerson has a little arrow showing the other properties I can bind to. Age and Name in this case.

The same thing happens when I set d:DataContext to a d:DesignData Source. I didn’t use that for this example because it is more complicated. But that is where I really want this to work because then I can see all my binding options AND have sample data.

If I instead do this in my view:

<Window x:Class="WpfApplication2.MainWindow"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApplication2"
        mc:Ignorable="d"
 Title="MainWindow" Height="350" Width="525">
 <Window.Resources>
 <local:ViewModel x:Key="DummyVM"/>
 </Window.Resources>
 <Grid d:DataContext="{Binding Source={StaticResource DummyVM}}">

 </Grid>
</Window>

Then I CAN see the properties of InterfacePerson, however, I still cant get the easy implementation of sample data that I would like using d:DesignData.

It should be noted that in all cases, if I manually type in the path it works fine. This is purely a matter of getting Blend to show them so it is easier to set up the bindings.

Thanks for any help you can provide on this!

  • 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-16T20:48:46+00:00Added an answer on May 16, 2026 at 8:48 pm

    I am pretty sure they use reflection to identify the properties of an object and an Interface is only a description of layout, not a real object, so has no reflected properties.

    Hope this helps.

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

Sidebar

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.