AQSRanck wrote at 2014-06-25 02:38:
objo wrote at 2014-06-25 09:55:
MeshBuilder.AddSurfaceOfRevolutionin the example
Source\Examples\WPF\ExampleBrowser\Examples\BuildingDemo\SiloVisual3D.cs, I think a similar approach can be used to model a funnel.
AQSRanck wrote at 2014-06-25 13:59:
AQSRanck wrote at 2014-06-26 04:15:
Thank you for your suggestion, I should not have much trouble creating a FunnelVisual3D. But I have hit a real snag. I work in VB rather than C# so I need to write my own version of theSiloVisual3D. However, I don't understand the lambda contained in the Dependency property, shown below.
My version for VB will look about like this: (However the lambda is not quite right)
public static readonly DependencyProperty DiameterProperty = DependencyPropertyEx.Register<double, SiloVisual3D>("Diameter", 40, (s, e) => s.AppearanceChanged());
I'm not asking for you to fix my code, but rather to help me understand the C# version, so that I can fix the VB version myself.
Public Shared ReadOnly DiameterProperty As DependencyProperty = DependencyPropertyEx.Register(Of Double, SiloVisual3D)("Diameter", 40, Function(s, e) s.AppearanceChanged())
Once I master SiloVisual3D (in VB) I fully expect to create an entire library of specialized visuals for my needs, so getting past this snag is kind of important for me.
Now that I see this example from Building Demo, the funnel shape should not be to hard.
objo wrote at 2014-06-26 05:43:
But you could change to standard dependency property registration with
DependencyProperty.Register, see http://msdn.microsoft.com/en-us/library/ms750428(v=vs.110).aspx
Make sure you add the property changed calback to the metadata.
RobPerkins wrote at 2014-06-26 17:15:
(because the lambda is supposed to be a function returning "void" (in C# terms) and in VB, that's represented with a Sub() lambda instead of a Function() )
Public Shared ReadOnly DiameterProperty As DependencyProperty = DependencyPropertyEx.Register(Of Double, SiloVisual3D)("Diameter", 40, Sub(s, e) s.AppearanceChanged())
AQSRanck wrote at 2014-06-26 17:45:
Would you believe that I spent the better part of a day because I forgot that rule.
Thank you very much Rob
Customer support service by UserEcho