Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when parsing XAML with a line in it #828

Open
JoshWobbles opened this issue Jun 8, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@JoshWobbles
Copy link

commented Jun 8, 2019

I get an error when trying to parse the XAML this creates when I have a line in the markup. Path, rectangle etc all seem fine, but as soon as I draw a line it throws the following error:

System.Xaml.XamlObjectWriterException
HResult=0x80131500
Message=Set property 'System.Windows.FrameworkElement.Margin' threw an exception.
Source=System.Xaml
StackTrace:
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, > Object value)
Inner Exception 1:
ArgumentException: 'Auto,Auto,0,0' is not a valid value for property 'Margin'.

For reference, the code I am using to parse the XAML is:

        var sb = new StringBuilder();
        using (var xmlWriter = new XamlXmlWriter(sb))
        {
            designSurface.SaveDesigner(xmlWriter);
        }
        var xamlCode = sb.ToString();

        UIElement rootElement;
        rootElement = (UIElement)XamlReader.Parse(xamlCode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.