I have an `XElement` and an `XPath` expression that selects a node from it. It works fine in the original program that I wrote it in but doesnt work if I paste it to another program. I've checked the references and import statements. What am i doing wrong?
I think the problem might be that the original program had the code within the class of a wpf window while it was moved to a abstract class where it doesnt work.
Dim X As XElement = _
<ModelVisual3D x:Name="World" mlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
>
<ModelVisual3D x:Name="AmbientLightContainer">
<ModelVisual3D.Content>
<AmbientLight x:Name="AmbientLight" Color="#FF7F7F7F"/>
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D x:Name="DefaultGroup">
<ModelVisual3D.Content>
<GeometryModel3D x:Name="Suzanne" d:Bounds="-1.36718797683716,-0.851562976837158,-0.984375,2.73437595367432,1.70312595367432,1.96875 ">
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="0.46875,0.75781298,-0.24218801 0.4375,0.765625,-0.16406301 0.5,0.6875,-0.09375 0.5625,0.671875,-0.24218801 -0.5,0.6875,-0.09375 -0.4375,0.765625,-0.16406301 -0.46875,0.75781298,-0.24218801 -0.5625,0.671875,-0.24218801 0.546875,0.578125,-0.054687999 0.625,0.5625,-0.24218801 -0.546875,0.578125,-0.054687999 -0.625,0.5625,-0.24218801 0.35156301,0.71875,-0.03125
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<DiffuseMaterial Brush="#FFFFFFFF"/>
</GeometryModel3D.Material>
</GeometryModel3D>
</ModelVisual3D.Content>
<ModelVisual3D.Transform>
<Transform3DGroup>
<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
<ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
<RotateTransform3D d:EulerAngles="0,0,0"/>
</Transform3DGroup>
</ModelVisual3D.Transform>
</ModelVisual3D>
</ModelVisual3D>
Dim XPath As String
XPath = "//Transform3DGroup"
X.XPathSelectElement(XPath).Remove()
Console.WriteLine(X.ToString)