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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:01:12+00:00 2026-06-10T15:01:12+00:00

Expected Behavior There are ComboBox and DatePicker. On Selection changed of the combo box,

  • 0

Expected Behavior

  1. There are ComboBox and DatePicker.
  2. On Selection changed of the combo box, depending on the combobox selection the DatePicker should be enabled or disabled.

How I am trying to implement

XAML code for Date Interval and Date Picker

<ComboBox ItemsSource="{Binding Source={StaticResource viewByInterval}}"
          SelectedValuePath="Value"
          SelectedItem="{Binding IntervalMode,Mode=TwoWay}" />

<DatePicker SelectedDate="{Binding EndDate,Mode=TwoWay}"
            IsEnabled="{Binding Path=EndDateEnabled[0],Mode=TwoWay}">

View Model code for changing the EndDateEnabled

public bool EndDateEnabled { get; set; }

public DateMode IntervalMode
{
    get
    {
        return _dateModeValue;
    }
    set
    {
        _dateModeValue = value;
        EndDateEnabled =  (value == DateMode.CustomDateRange);                
    }
}

I am unable to achieve the functionality.
Please advice.

  • 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-10T15:01:13+00:00Added an answer on June 10, 2026 at 3:01 pm

    You don’t need the [0] part (it’s a bool, not a collection), and the binding doesn’t need to be TwoWay:

    IsEnabled="{Binding Path=EndDateEnabled}"
    

    You also need to implement INotifyPropertyChanged in your ViewModel, and raise the PropertyChanged event for the EndDateEnabled property (and for all properties that your view is bound to):

    private bool _endDateEnabled;
    public bool EndDateEnabled
    {
        get { return _endDateEnabled; }
        set
        {
            if (value != _endDateEnabled)
            {
                _endDateEnabled = value;
                OnPropertyChanged("EndDateEnabled");
            }
        }
    }
    

    Note that EndDateEnabled can also be a computed property with only a getter:

    public bool EndDateEnabled
    {
        get { return _dateModeValue == DateMode.CustomDateRange; }
    }
    

    In this case you need to call OnPropertyChanged("EndDateEnabled") in the DateModeValue setter, so that the binding is refreshed.

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

Sidebar

Related Questions

Is it expected behavior that two encodings can map to the same decoding? I'm
I encountered some curious behavior today and was wondering if it is expected or
Is there a well-supported, common behavior that I can expect if I do something
On this page , the expected behavior is to display the custom sizes input
I'm trying to animate a UIButton. But during it's animation, there is no interaction
I have a question about the expected behavior of Window Phone 7.5 emulator. If
Using the code below, the expected behavior is that the database won't reflect the
JRE Version 1.7 Update 3 EXPECTED BEHAVIOUR As I run the program, it works
Does any know if the following is the expected behaviors in terms of what
Expected Outcome: Successful installtion of Plone 4.1.4 Actual Outcome: Installation fails with: libxml2: cmmi

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.