[英]textblock as a curve in windows phone 8
我想創建一個彎曲的文本塊。 它有點類似於此: http : //i.stack.imgur.com/sCJuQ.gif 如何在表情融合中做到這一點? 即使我嘗試在路徑列表框布局上設置文本塊,它也會以垂直方式而不是在路徑布局上打印。
<FrameworkElement.Resources>
<TextBlock x:Key="TextRes" Text="world wide web"/>
</FrameworkElement.Resources>
<mec:PathListBox ItemsSource="{Binding Text, Source={StaticResource TextRes}}">
<mec:PathListBox.LayoutPaths>
<mec:LayoutPath Orientation="OrientToPath">
<mec:LayoutPath.SourceElement>
<Ellipse Height="436" Width="352" />
</mec:LayoutPath.SourceElement>
</mec:LayoutPath>
</mec:PathListBox.LayoutPaths>
</mec:PathListBox>
PathListBox
。 關鍵是將ItemsSource
設置為string並使用OrientToPath
。 以下xaml用於WP7。
<mec:PathListBox xmlns:mec="clr-namespace:Microsoft.Expression.Controls;assembly=Microsoft.Expression.Controls"
ItemsSource="world wide web">
<mec:PathListBox.LayoutPaths>
<mec:LayoutPath Orientation="OrientToPath">
<mec:LayoutPath.SourceElement>
<Ellipse Height="91" Width="300"/>
</mec:LayoutPath.SourceElement>
</mec:LayoutPath>
</mec:PathListBox.LayoutPaths>
</mec:PathListBox>
即使設計師對字符串發出警告,它仍會編譯並運行。 或者您可以這樣做:
<FrameworkElement.Resources>
<TextBlock x:Key="TextRes" Text="world wide web"/>
</FrameworkElement.Resources>
<mec:PathListBox
ItemsSource="{Binding Text, Source={StaticResource TextRes}}">
<mec:PathListBox.LayoutPaths>
<mec:LayoutPath Orientation="OrientToPath">
<mec:LayoutPath.SourceElement>
<Ellipse Height="91" Width="300"/>
</mec:LayoutPath.SourceElement>
</mec:LayoutPath>
</mec:PathListBox.LayoutPaths>
</mec:PathListBox>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.