我得到了这段代码:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Canvas>
<TextBlock Name="txtblk"
Canvas.Left="100" Canvas.Top="100"
Text="ROTATE">
</TextBlock>
</Canvas>
</Grid>
它运行良好,我可以看到我的 TextBlock。但是如果我向它添加一个“投影”属性:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Canvas>
<TextBlock Name="txtblk"
Canvas.Left="100" Canvas.Top="100"
Text="ROTATE">
<TextBlock.Projection>
<PlaneProjection x:Name="planeProjection"
CenterOfRotationX="0.5" CenterOfRotationY="0.5"
RotationZ="45"/>
</TextBlock.Projection>
</TextBlock>
</Canvas>
</Grid>
TextBlock 刚刚消失了!页面中没有其他控件。
谁能告诉我发生了什么?我真的被困住了。
谢谢!
PS完整的xaml如下:
<phone:PhoneApplicationPage
x:Class="WP7Test.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="728" d:DesignHeight="480"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Landscape" Orientation="Landscape"
shell:SystemTray.IsVisible="False">
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Canvas>
<TextBlock Name="txtblk"
Canvas.Left="100" Canvas.Top="100"
Text="ROTATE">
<TextBlock.Projection>
<PlaneProjection x:Name="planeProjection"
CenterOfRotationX="0.5"
CenterOfRotationY="0.5"
RotationZ="45"/>
</TextBlock.Projection>
</TextBlock>
</Canvas>
</Grid>
</Grid>
</phone:PhoneApplicationPage>