RotateManipulator help please
badgerbadger wrote at 2011-12-14 16:41:
I am attempting to code a RotateManipulator in C# codebehind (not xaml) to add rotateable and translateable planes on a double click event.
How would this line from ManipulatorDemo / MainWindow.xaml line 185 be coded in c#?
<ht:RotateManipulator Color="Blue" Axis="0,0,1" Transform="{Binding Transform, ElementName=plane2}" TargetTransform="{Binding Transform, ElementName=plane2}" Diameter="1"/>
It is the syntax of the binding transforms that I am struggling with (I am new to wpf if you haven't guessed)
Thanks! badgerbadger.
objo wrote at 2011-12-14 19:26:
use the SetBinding method
http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.setbinding.aspx
badgerbadger wrote at 2011-12-15 10:11:
Thanks, I had been using that but not getting it to work. Attempted to code ManipulatorDemo / MainWindow.xaml line 185 as
var plane = new RectangleVisual3D();
plane. etc
var manip = new RotateManipulator();
...
BindingOperations.SetBinding(manip, RotateManipulator.TransformProperty, new Binding("Transform") { ElementName = "plane" });
BindingOperations.SetBinding(manip, RotateManipulator.TargetTransformProperty, new Binding("Transform") { ElementName = "plane" });
and other combinations of setBinding but get "System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=plane'"...
Apologies if this is a newbie wpf error but not finding much relevant on the web
Customer support service by UserEcho
I have read many blogs. This blog is the best I have ever come across. Thanks for creating this blog.
สล็อตออนไลน์
สล็อตออนไลน์เว็บไหนขั้นต่ำ 1 บาท2021
https://stormlordpublishing.com/สล็อตออนไลน์เว็บไหนดี