Saturday, 15 August 2015

Binding to Transform3dGroup in WPF -



Binding to Transform3dGroup in WPF -

i have working info binding (wpf, c#, net4.5) between element of view (a perspectivecamera target) , transform3dgroup alltransform {get; set;} regular .net property source part of viewmodel. need know why/how working.

the transform3dgroup has translatetransform3d object in list of children. changing offset properties of translatetransform within viewmodel:

// create transform grouping this.alltransforms = new transform3dgroup(); this.translatetopos = new translatetransform3d(); alltransforms.children.add(translatetopos); ... // updating translation while rendering done this. // x, y, z properties of class this.translatetopos.offsetx = this.x; this.translatetopos.offsety = this.y; this.translatetopos.offsetz = this.z;

so photographic camera bound transform grouping reacts (with translation). in understanding of info binding dependencyproperty capable of informing bound property of changes, transform3dgroup isn't dependencyproperty, how work? children collection of transform3dgroup dependencyproperty not changing collection, updating 1 of members. offsetx, offsety, offsetz properties in translatetransform3d dependencyproperty. how alter notification propagated owning transformgroup3d?

you have answer, allow me explain it

you not changing value of property alltransforms normal property manipulating values of 1 of it's kid transform property how changed reach bound camera?

some facts

transform3dgroup dependencyobject property children in transform3dgroup of type transform3dcollection dependencyobject and actual kid translatetransform3d dependencyobject

all of above capable of notifying parent

so when ever modify translatetopos translatetransform3d

it notifies alter parent transform3dcollection transform3dcollection notify parent in transform3dgroup transform3dgroup notify photographic camera bound it. camera receives latest computed value transform3dgroup , reacts accordingly.

i hope able explain it

wpf data-binding dependency-properties

No comments:

Post a Comment