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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:19:18+00:00 2026-05-25T23:19:18+00:00

I believe we cannot bind to internal viewmodel. Therefore I think all binding related

  • 0

I believe we cannot bind to internal viewmodel.

Therefore I think all binding related implementations of IValueConverter, IMultiValueConverter, INotifyPropertyChanged, INotifyCollectionChanged should be always public in order to work with XAML.

Is that correct?

UPDATE: this isn’t such an easy question because there are various possible weird cases, like nested viewmodel classes, or explicit interface implementations or something else that I am not aware of which could possibly lead to different answers. As we already can see WPF and SL4.0 treat internal viewmodels differently for some reason.

  • 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-25T23:19:18+00:00Added an answer on May 25, 2026 at 11:19 pm

    Did some checking, based on this code:

    <UserControl>
        <UserControl.Resources>
            <sa1:TestValueConverter x:Key="TestValueConverter" />
        </UserControl.Resources>
    
        <Grid x:Name="LayoutRoot" Background="White">
            <TextBlock Text="{Binding Data, Converter={StaticResource TestValueConverter}}" />
        </Grid>
    </UserControl>
    
    public class TestViewModel : INotifyPropertyChanged
    {
        public string Data { get; set; }
        public event PropertyChangedEventHandler PropertyChanged;
    }
    
    public class TestValueConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return "-" + value.ToString() + "-";
        }
    
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    

    Interestingly enough, results are different for WPF and Silverlight.

    And answers are:

    In Silverlight:

    1. “I believe we cannot bind to internal viewmodel” – yes we cannot
      bind to internal class, nor can we bind to internal or private
      properties, gives binding error.

    2. “implementations of IValueConverter, IMultiValueConverter” – yes also should be public

    3. “INotifyPropertyChanged, INotifyCollectionChanged” – these interfaces are implemented by classes of ViewModel and some collection that will be bound, so these classes should be public as we already know. And methods and events that implement interfaces cannot be private or internal obviously.

    In WPF:

    1. “I believe we cannot bind to internal viewmodel” – we can bind to internal class, but we cannot bind to internal or private properties.

    2. “implementations of IValueConverter, IMultiValueConverter” – can be internal

    3. “INotifyPropertyChanged, INotifyCollectionChanged” – see previous points.

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

Sidebar

Related Questions

I'm lead to believe that I cannot count on the order of items added
The commons FileUtils look pretty cool, and I can't believe that they cannot be
I cannot believe I'm the first person to go through this thought process, so
I simply cannot believe this is quite so hard to determine. Even having read
This is an absolute howler. I cannot believe my own eyes, and I cannot
I cannot believe that nobody has gotten across this or perhaps I'm just missing
I cannot believe I am having trouble with this following string String filter =
This is something that I cannot believe I have not been able to figure
Somehow I cannot believe that I am the first one to run into that
My problem is so simple, that I cannot believe that there is no HTML/CSS

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.