// 1. selected WPF element: This selects an ellipse (elliptical) object <br/> ellipse uiobject = new ellipse (); </P> <p> // 2. selected CLR element: This selects a location (two-dimensional coordinate) object <br/> location position = new location (); </P> <p> // 3. select the property to be bound to the WPF element: the canvas of ellipse is selected. left additional attribute </P> <p> // 4. select the property to be bound to the CLR element: select the property X of location </P> <p> // 5. set binding details </P> <p> // 5. 1. instantiate the binding class <br/> binding bindingleftproperty = new binding (); </P> <p> // 5. 2. specify the specific parameters of the bound object, and set the source and its property path (represented by a string) <br/> bindingleftproperty. source = position; <br/> bindingleftproperty. path = new propertypath ("X"); </P> <p> // 5. 3. set binding mode: Select twoway <br/> bindingleftproperty. mode = bindingmode. twoway; </P> <p> // 6. bind and associate <br/> uiobject. setbinding (canvas. leftproperty, bindingleftproperty );