/// <summary> /// Invoked when a points number changes. /// </summary> /// <param name="d">The object whose value changed.</param> /// <param name="e">Details of the change.</param> private static void OnPointsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DoubleTrackCrossoverPair obj = (DoubleTrackCrossoverPair)d; SectionPointPosition leftNormalSPP = new SectionPointPosition(obj.LeftPoints, false); SectionPointPosition leftReverseSPP = new SectionPointPosition(obj.LeftPoints, true); SectionPointPosition rightNormalSPP = new SectionPointPosition(obj.RightPoints, false); SectionPointPosition rightReverseSPP = new SectionPointPosition(obj.RightPoints, true); obj.LeftNormalSPP = new List <SectionPointPosition> { leftNormalSPP }; obj.LeftReverseSPP = new List <SectionPointPosition> { leftReverseSPP }; obj.RightNormalSPP = new List <SectionPointPosition> { rightNormalSPP }; obj.RightReverseSPP = new List <SectionPointPosition> { rightReverseSPP }; obj.BothNormalSPP = new List <SectionPointPosition> { leftNormalSPP, rightNormalSPP }; }
/// <summary> /// Invoked when the invert property changes. /// </summary> /// <param name="d">The object whose value changed.</param> /// <param name="e">Details of the change.</param> private static void OnInvertChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DoubleTrackCrossoverPair obj = (DoubleTrackCrossoverPair)d; if (obj.Invert) { obj.InvertTransform = new ScaleTransform(1, -1); obj.HFlipInvertTransform = new ScaleTransform(-1, -1); } else { obj.InvertTransform = new ScaleTransform(1, 1); obj.HFlipInvertTransform = new ScaleTransform(-1, 1); } }