public VectorInput(PropertyInfo prop, object owner, NodeType type = NodeType.Float4, NumberInputType ntype = NumberInputType.Float) { InitializeComponent(); property = prop; propertyOwner = owner; switch (type) { case NodeType.Float2: ZPos.Visibility = Visibility.Collapsed; WPos.Visibility = Visibility.Collapsed; break; case NodeType.Float3: ZPos.Visibility = Visibility.Visible; WPos.Visibility = Visibility.Collapsed; break; case NodeType.Float4: ZPos.Visibility = Visibility.Visible; WPos.Visibility = Visibility.Visible; break; } object b = prop.GetValue(owner); if (b == null) { pc = new VectorPropertyContainer(new MVector()); } else { MVector vec = (MVector)b; pc = new VectorPropertyContainer(vec); } pc.OnUpdate += Pc_OnUpdate; var xprop = pc.GetType().GetProperty("XProp"); var yprop = pc.GetType().GetProperty("YProp"); var zprop = pc.GetType().GetProperty("ZProp"); var wprop = pc.GetType().GetProperty("WProp"); XPos.Set(ntype, pc, xprop); YPos.Set(ntype, pc, yprop); ZPos.Set(ntype, pc, zprop); WPos.Set(ntype, pc, wprop); }