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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:39:13+00:00 2026-05-27T09:39:13+00:00

Requirement 1 Let’s say I have some view model with two DateTime properties, Start

  • 0

Requirement 1

Let’s say I have some view model with two DateTime properties, Start and End. I would like for End to be set to some offset from Start, and for this to be maintained even as Start changes. This is easy enough by listening to the property notification for Start and then setting End.

Requirement 2

Now, let’s add the fun part: I want to be able to stop adjusting End if the user explicitly changes it. Put another way, let’s say it’s an airline reservation system, and we want to set the end date to 3 days later (based on the average length of stay), but if the user explicitly sets the end date to a specific date, then when he/she sets the start date again, the end date stays).

The Problem

On first thought, it would seem you could just listen for End‘s notification and set some value that the handler will see when handling Start, and say “ok, I won’t adjust End. The problem is that End doesn’t know why it is being changed, so the handler for End‘s change will blithely set the stop-changing condition immediately. This violates requirement #1.

How can I satisfy both requirements?

  • 1 1 Answer
  • 1 View
  • 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-27T09:39:14+00:00Added an answer on May 27, 2026 at 9:39 am

    Let’s say we have a flag AutoAdjust that tells you if you should adjust End when Start changes. AutoAdjust is initially true.

    Whenever End is set, if the interval between Start and End is different than the “default” interval, set AutoAdjust to false.

    Whenever Start is set, if AutoAdjust is true then adjust the value of End.

    Note that with this scheme, it will never be possible to set AutoAdjust back to true once it flips to false. This is intentional, and IMHO more intuitive than allowing AutoAdjust to flip back — the user can easily reason that the end date has stopped auto-adjusting because they manually modified it, but it’s not as intuitive to think that if they set it back to its “auto” value it will start auto-adjusting again.

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

Sidebar

Related Questions

Let's say I have two classes. Each class has one parameter. Parameter of first
Let's say I have a collection of Person objects, each of which looks like
I have a requirement to let my users maintain some accounts and accommodations. Each
I've a requirement in which I have a start and End time. For instance
let's say we have a model called Student and it has a string field
Let's say I have some code that is ordered, but the ordering is not
Let me explain the application. Before starting my question, I would like to say
I have a text file as input like this:let say it as xyz.txt TIME
Let's say I have a requirements document in MS Word, and someone else reviews
Let me brief you the whole requirement first. I have the following HTML code:

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.