AB4D Forum

Full Version: isVisible's problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I find problem, when need change isVisible (Ab3d.Visuals.BaseVisual3D) with binding
Why
***
savedHiddenContent = Content
****
in protected override void UpdateContentIfNotInizializing() (BaseModelVisual3D )


after that savedHiddenContent always = null and update Content in RefreshMaterial method withaut savedHiddenContent

If do : //savedHiddenContent = Content, then ok:)))
Is this bug?

Sorry

// savedHiddenContent = null;
I am sorry that I have not answered to your post on Ab4d forum. Somehow I missed it.

I have checked the source and could not see the problem with the current implementation (understaning the following probably required to have the source code of the library):
In UpdateContentIfNotInizializing the savedHiddenContent is set to null because UpdateContentIfNotInizializing is called when a property is changed - in that case the savedHiddenContent is no longer valid and needs to be regenerated. This happens when IsVisible is set to true or when EndInit is called - than UpdateContentIfNotInizializing is called and this calls CreateModel that updates the geomery and material.

If you would comment the "savedHiddenContent = null;" when the object is not visible than it could happen that some properties are changed (for example size of the object) but when the IsVisible would be set back to true, the savedHiddenContent would be shown without any changes applied (if savedHiddenContent is null when the object is shown again, its geometry and material is refreshed).

So I cannot find a problem with the current implementation (there is also a sample in multitouch camera that is using binding on IsVisible and it works correctly). But this does not mean that there is no problem - I would really ask you if you can provide some more details to reproduce the problem.