private static LineSegment CreateLineSegment <TArg1, TArg2>(DependencyValue <TArg1> arg1, DependencyValue <TArg2> arg2, Func <TArg1, TArg2, PointDouble> convertToPointFn)
        {
            LineSegment targetObject = new LineSegment();

            object[] sourceObjects = new object[] { arg1, arg2 };
            PaintDotNet.ObjectModel.PropertyPath[] sourcePaths = new PaintDotNet.ObjectModel.PropertyPath[] { new PaintDotNet.ObjectModel.PropertyPath(arg1.GetValueProperty().Name, Array.Empty <object>()), new PaintDotNet.ObjectModel.PropertyPath(arg2.GetValueProperty().Name, Array.Empty <object>()) };
            targetObject.SetMultiBinding(LineSegment.PointProperty, sourceObjects, sourcePaths, BindingMode.OneWay, values => convertToPointFn((TArg1)values[0], (TArg2)values[1]), null);
            return(targetObject);
        }
        private static LineSegment CreateLineSegment <TArg1>(DependencyValue <TArg1> arg1, Func <TArg1, PointDouble> convertToPointFn)
        {
            LineSegment targetObject = new LineSegment();

            targetObject.SetBinding <TArg1, PointDouble>(LineSegment.PointProperty, arg1, new PaintDotNet.ObjectModel.PropertyPath(arg1.GetValueProperty().Name, Array.Empty <object>()), BindingMode.OneWay, convertToPointFn);
            return(targetObject);
        }