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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:22:17+00:00 2026-06-03T04:22:17+00:00

Hello guys and sorry for such a long question, but… I have a C#

  • 0

Hello guys and sorry for such a long question, but…

I have a C# interface like this one:

public interface ISimpleViewModel
{
    string SimpleText { get; }
}

Then I have a F# type inherited from it:

type SimpleViewModel() = 
    interface ISimpleViewModel with
        member this.SimpleText
            with get() = "Hello again!"

Also I have a C# inheritor:

public class SimpleCSViewModel : ISimpleViewModel
{
    public string SimpleText
    {
        get { return "Just testing"; }
    }
}

Eventually I have a super simple WPF application which MainWindow ctor is injected with ISimpleViewModel instance this way:

public partial class MainWindow : Window
{
    public MainWindow(ISimpleViewModel viewModel)
    {
        ViewModel = viewModel;
        InitializeComponent();
    }

    public ISimpleViewModel ViewModel
    {
        get { return DataContext as ISimpleViewModel; }
        set { DataContext = value; }
    }
}

And of course I have a TextBlock on my Window which Text Property is binded to SimpleText.

Everyting works in case when I’m injecting C# instance. But I receive BindingError that property could be found in case of F# instance. Why it could be so?

  • 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-03T04:22:18+00:00Added an answer on June 3, 2026 at 4:22 am

    I don’t know enough about how WPF binding works to be sure, but one thing to keep in mind is that interfaces in F# are explicitly implemented (meaning that the implementing methods are actually non-public), but by default they’re implicit in C#. What happens if you use an explicit interface implementation in C# instead? If this is indeed the problem then the simplest fix would just be to create a public property on your F# type which duplicates the behavior of the interface implementation.

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

Sidebar

Related Questions

Hello guys sorry if the question looks stupid to you. i have 3 tables
Hello guys I have a map like this http://sinanisler.com/demo/map/ and as you can see
Hello guys, I have been trying to implement the DSUM function but failed to
Hello guys i have cells in tableview, but there are two different UIButtons to
Hello guys i have a problem streaming PDF files with php, i'm using this
Hello Guys! See I have been creating a code powered with ajax but it
Hello guys, I have an error I cannot solve, on a ASP.NET website. One
Hello guys i have collection : public class ActionData { private int iD; public
Hello guys I have a question regardless a old code a client needed a
Hello guys in my code i'm getting this stack: Traceback (most recent call last):

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.