I have XML like the following:
<CallStep>
<StepXaml>
<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:uc="clr-namespace:CallTracker.Library.UserControls.BaseUserControls;assembly=CallTracker.Library">
<uc:LabelValueControl Label="TestLabel" Value="356733" />
</StackPanel>
</StepXaml>
</CallStep>
that I would then like to store in a property
[XmlElement("StepXaml")]
public object StepXaml { get; set; }
I am using XmlSerializer to deserialize the XML into a class containing the StepXaml property. Currently when I deserialize the XML, the <StackPanel>
is being deserialized into its own node.
Is there a way to prevent the deserializer from trying to drill down into <StackPanel>
, but rather have everything between <StepXaml>
& </StepXaml>
returned as one object?