View Code
我想获取StackPanel里图片的Height的PropertyPath 图片是动态加的
<Viewport3D x:Name="viewPort3D" IsHitTestVisible="False" RenderOptions.EdgeMode="Aliased" ClipToBounds="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Viewport3D.Camera>
<PerspectiveCamera Position="-0.3,-0.5,9" />
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<AmbientLight Color="White"/>
</ModelVisual3D.Content>
</ModelVisual3D>
<Viewport2DVisual3D x:Name="viewport2DVisual3D0" Geometry="{StaticResource geometry1}" Material="{StaticResource material}">
<Viewport2DVisual3D.Transform>
<Transform3DGroup>
<Transform3DGroup>
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Axis="0,1.,0" Angle="-45"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>
<TranslateTransform3D OffsetX="-3.95" OffsetY="0" OffsetZ="0" />
<ScaleTransform3D ScaleX="1.04" ScaleY="1.55"></ScaleTransform3D>
</Transform3DGroup>
</Transform3DGroup>
</Viewport2DVisual3D.Transform>
<Viewport2DVisual3D.Visual>
<StackPanel Name="lp0">
<Image Source="Images\050817goodfeng14.jpg" Opacity="1" />
</StackPanel>
<!--<Border Style="{StaticResource border}">
<Image Source="Images\050817goodfeng14.jpg" Opacity="1" />
</Border>-->
</Viewport2DVisual3D.Visual>
</Viewport2DVisual3D>