我這一段代碼:爲什麼TextBlock不能在畫布中顯示Projection屬性?
<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剛剛消失!頁面中沒有其他控件。
誰能告訴我發生了什麼事?我很困難。
謝謝!
P.S.完整的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>
你能發佈更多的XAML? – Robaticus 2012-04-19 18:58:06