I'm starting a project with XAF and I have done a WinModificationsController for a single DetailsView, but seems that when I add that Controller I can't save DetailViews from other object, so the controller works for the class that is targeting but sunddently I can't save other objects. I don't know if I make myself clear, any help is appreciated. Thanks.
XAF. When I add a WinModificationsController for a single DetailView I can't save other DetailsViews
Asked
Active
Viewed 254 times
1
-
Could you share your relevant code? – kenorb Nov 10 '16 at 13:38
2 Answers
0
From what i can understand from your question your view controller is firing for all detail views, you can add TargetObjectType
or TargetViewId
properties into the view controller constructor to only fire the controller for a specific object type or view.

Shwabster
- 479
- 1
- 10
- 27
0
Instead of inheriting the WinModificationsController you need to instead modify that controller by getting a reference to it via Frame.GetController() inside of a view controller. Here's how I did it in one of my view controllers:
...
protected override void OnActivated()
{
base.OnActivated();
var modifications = Frame.GetController<ModificationsController>();
if (modifications != null)
{
modifications.ModificationsCheckingMode = ModificationsCheckingMode.Always;
modifications.ModificationsHandlingMode = ModificationsHandlingMode.AutoCommit;
}
}

CalebHC
- 4,998
- 3
- 36
- 42