This question is locked. New answers and comments are not allowed.
Hi.
I have a ScheduleView with four different ViewDefinitions, all of them loading their own different data.
In one of the views, the user is able to add/modify multiple appointments before pressing a save button that will save all modifications in a batch.
Now I want the user to get a warning when he tries to switch to another view without saving first.
I have an IsModified flag on the appointment, so it is easy for me to check if any appointments are modified and display a warning message with OK/Cancel buttons.
But how can I prevent the view switch if the user wants to abort?
Today I have bound ActiveViewDefinition in my view model that will throw an event back to my ScheduleView whenever the view is changed. The problem is that this event will be triggered too late, when the view has already changed.
So, can I trigger it sooner and can I cancel the view switch somehow?
Regards,
Håkan
I have a ScheduleView with four different ViewDefinitions, all of them loading their own different data.
In one of the views, the user is able to add/modify multiple appointments before pressing a save button that will save all modifications in a batch.
Now I want the user to get a warning when he tries to switch to another view without saving first.
I have an IsModified flag on the appointment, so it is easy for me to check if any appointments are modified and display a warning message with OK/Cancel buttons.
But how can I prevent the view switch if the user wants to abort?
Today I have bound ActiveViewDefinition in my view model that will throw an event back to my ScheduleView whenever the view is changed. The problem is that this event will be triggered too late, when the view has already changed.
So, can I trigger it sooner and can I cancel the view switch somehow?
Regards,
Håkan