Replies: 2 comments 7 replies
-
The easiest solution is to increase the edit level in the method invoked to lazy load the object. Something like this (from memory): public static readonly PropertyInfo<PersonEdit> ChildProperty = RegisterProperty<PersonEdit>(nameof(Child));
public PersonEdit Child
{
get => LazyGetPropertyAsync(ChildProperty, async () =>
{
if (FieldManager.FieldExists(ChildProperty))
{
return Task.FromResult(default(PersonEdit));
}
else
{
var result = DataPortal.FetchAsync<PersonEdit>("c"));
for (i = 0; i < this.EditLevel; i++)
result.BeginEdit();
return result;
}
}
set => SetProperty(ChildProperty, value);
} |
Beta Was this translation helpful? Give feedback.
5 replies
-
Hi Rocky, did you give more thoughts on this? I think that at least bugfix for scenario 1 could be implemented |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a bo with some lazyload properties shown in a windows form app.
Since the lazyload properties are heavy to load , I only load them if the user clicks on their respective tabpage. The user can click in the tabpage before or after beginning an edit in this form.
When the user begins the form edit I call my bo.BeginEdit() so I can call bo.CancelEdit() if the user wants to rollback his changes.
However the Lazyload fields are rolled back only if they were loaded previously (i.e. if the user clicked in the tabpage). If the user begins an edit, then clicks on the tabpage, the lazyload property is not rolled back on an undo operation.
What's the best/correct approach to solve this inconsistent behavior?
Kind regards
Beta Was this translation helpful? Give feedback.
All reactions