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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:41:25+00:00 2026-06-09T15:41:25+00:00

I have an application where you can select between different objects in a ListBox.

  • 0

I have an application where you can select between different objects in a ListBox. When you select an object, it changes the viewmodel for a control. The control utlizes the Timeline Control from CodePlex, and because of this, I have the StartDate and EndDate for the timeline data bound to ViewModel. When the ViewModel is changed out, I sometimes get an error:

ArgumentOutOfRangeException: MaxDateTime cannot be less then MinDateTime

This only occurs when I go from a later date to an earlier date. I am pretty sure that is due to the way the Properties are automatically updated to the view. This is the relevant XAML.

MaxDateTime="{Binding Path=RecordingEnd}" 
MinDateTime="{Binding Path=RecordingStart}" 
CurrentDateTime="{Binding Path=CurrentDateTime, Mode=TwoWay}"

The ViewModel has this:

        private int myObjectIndex;
        public int MyObjectIndex
        {
            get { return myObjectIndex; }
            set { myObjectIndex = value; OnPropertyChanged("MyObjectIndex"); MyObject = MyObjects[myObjectIndex]; }
        }

        private MyObjectViewModel myObject=new MyObjectViewModel();

        public MyObjectViewModel MyObject            {
            get { return myObject; }
            set
            {
                myObject= value;
                OnPropertyChanged("MyObject");
            }
        }

Is there a way around this problem? Is there a way to tell WPF which order the parameters within an object should be updated?

Update:
I ended up using a variation of @colinsmith’s response:

public MyObjectViewModel MyObject {
    get { return myObject; }
    set 
    {
        myObject= new MyObjectViewModel();
        OnPropertyChanged("MyObject");

        myObject= value;
        OnPropertyChanged("MyObject");    
    } 
}
  • 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-09T15:41:26+00:00Added an answer on June 9, 2026 at 3:41 pm

    Could you try this:

    public MyObjectViewModel MyObject            {
                get { return myObject; }
                set
                {
                    myObject=null;
                    OnPropertyChanged("MyObject");
    
                    myObject= value;
                    OnPropertyChanged("MyObject");
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text to speech application where the user can select a language
I have a view from which I have to select data between 2 given
I have an application that can filter a datagridview based on date using a
I have an application that can be viewed with landscape and portrait mode. I'm
I have an application that can potentially have hundreds of memory mapped, i.e., mmap()
In C++, a console application can have a message handler in its WinMain procedure,
I have an application where users can store items. Now each type of account
I have an application where I can launch a modal dialog box over a
I have an application where I can have an image moving towards the eye.
I have a web application that can load plugins through reflection. It currently uses

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.