Example #1
0
 public void SetChildren(SecondaryHandle before, SecondaryHandle after)
 {
     ChildBefore = before;
     ChildBefore.SetParent(this);
     ChildAfter = after;
     ChildAfter.SetParent(this);
 }
Example #2
0
        private void AddHandles(List <ControlPoint> controlPoints)
        {
            var beforeHandle = new SecondaryHandle(controlPoints.First());
            var mainHandle   = new Handle(controlPoints.ElementAt(1));
            var afterHandle  = new SecondaryHandle(controlPoints.Last());

            mainHandle.SetChildren(beforeHandle, afterHandle);

            beforeHandle.SetPosition(ToPixel(controlPoints.First().Position));
            mainHandle.SetPosition(ToPixel(controlPoints.ElementAt(1).Position));
            afterHandle.SetPosition(ToPixel(controlPoints.Last().Position));

            this.Children.Add(mainHandle);
            this.Children.Add(beforeHandle);
            this.Children.Add(afterHandle);

            beforeHandle.SetParent(mainHandle);
            afterHandle.SetParent(mainHandle);

            this.Children.Add(beforeHandle.Arm);
            this.Children.Add(afterHandle.Arm);

            RegisterHandleEvents(beforeHandle);
            RegisterHandleEvents(mainHandle);
            RegisterHandleEvents(afterHandle);
        }