帆布的RenderTransform错误“无法转换”的VisualStudio中2010 Silverlight 4中
问题描述:
<Canvas Width="945" Height="718" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Canvas RenderTransform="1.333333333,0,0,1.333333333,0,0" />
</Canvas>
这工作正常WPF,但在Silverlight帆布的RenderTransform错误“无法转换”的VisualStudio中2010 Silverlight 4中
以下错误错误3无法转换“1.333333333,0,0,1.333333333,0,0” 。
答
对我来说看起来像一个MatrixTransform
,使用元素语法明确地创建它,因为看起来不是类型转换器。
<Canvas.RenderTransform>
<MatrixTransform>
<MatrixTransform.Matrix>
<!-- I do not know the WPF parsing order
so you'll need to find out what goes where yourself -->
<Matrix OffsetX="???" OffsetY="???"
M11="???" M12="???"
M21="???" M22="???" />
</MatrixTransform.Matrix>
</MatrixTransform>
</Canvas.RenderTransform>
测试表明,这是各自的Matrix
:
<Matrix M11="1.333333333" M22="1.333333333"/>
什么是 “1.333333333,0,0,1.333333333,0,0” 代表什么? WPF和Silverlight之间的区别可能会在这里产生变化。 – ChrisF 2012-01-08 18:09:07