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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:14:54+00:00 2026-05-24T16:14:54+00:00

I have a ViewModel with 2 properties: IsReadOnly SomeCollectionViewSource This is a simple working

  • 0

I have a ViewModel with 2 properties:

  • IsReadOnly
  • SomeCollectionViewSource

This is a simple working view example:

<StackPanel DataContext="{Binding SomeCollectionViewSource}">
  <DatePicker SelectedDate="{Binding Path=Date}" IsEnabled="False" />      
</StackPanel>

Now I want to bind the IsEnabled property:

<StackPanel DataContext="{Binding}">
  <DatePicker SelectedDate="{Binding Path=?}" IsEnabled="{Binding IsReadOnly}" />      
</StackPanel>

How should the binding look like in this example? (I think I’m mising something simple)
I would prefer a short and easy binding since I have a lot of controls to bind.

Is there a better/easier way to make all controls on one CollectionViewSource read-only?

  • 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-24T16:14:54+00:00Added an answer on May 24, 2026 at 4:14 pm

    Under the assumption that the above binding targets the current item this should be equivalent:

    {Binding SomeCollectionViewSource.View/Date}
    

    Also see the references for Binding.Path and the PropertyPath syntax if you have not read them already, there’s a lot to it.

    The above binding (of your two bindings) is equivalent to:

    {Binding Path=/Date}
    

    The slash can be omitted and if the property is not found on the collection the binding looks for the property on the current item. so…

    {Binding Date} binds to: CurrentItem -> Date
    {Binding Count} binds to: Count
    

    For clarity i would suggest always explicity writing the slash.

    (Setting any DataContext to {Binding} is really pointless by the way)

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

Sidebar

Related Questions

I have a View with ViewModel as datacontext ( set in code) . In
I have a viewmodel class for a create view that consists of 2 properties
I have a viewmodel that contains a number of properties, a SelectList, and an
I have a user control let say UC1 . This user control have viewmodel
Hi people stackoverflow. I'm working with MVVM, I have ViewModel call UserViewModel with a
I have a TextBox.TextProperty bound to a ViewModel property. In the binding I have
I have a ViewModel called EntityRating, one of whose properties is AverageRating. When I
I have a simple ViewModel class like public class TestViewModel { public String Information
Here's simple view model that I use: public class ViewModel { public Order Order
I have a ViewModel class which has large number of properties(Say 50). Once the

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.