Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Quick easy points for anyone who knows the answer:

The following Xaml path works fine in WPF but crashes in Silverlight. I can verify this behaviour in Kaxaml.

The path code is

<Path Fill="#FFEDEDED" StrokeThickness="1" Stroke="#FFA3A3A3" Opacity="0.7" 
                VerticalAlignment="Center" HorizontalAlignment="Center" >
    <Path.Data>
        <PathGeometry Figures="m 1 2 l 4.0525 5.2361 l 4.0527 -5.2361 z "/>
    </Path.Data>
</Path>

The exception is a script error

Unhandled error in Silverlight Application. Failed to create a System.Windows.Media.PathFigureCollection from the text 'm 1 2 l 4.0525 5.2361 l 4.0527 -5.2361 z'

Its supposed to draw a triangle like so:

enter image description here

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

Unlike WPF Silverlight does not support converting a string to Figures.


I got the following underline/hover error message in Expression Blend:

enter image description here


The equivalent triangle, authored via Blend, for Silverlight is:

<Path Fill="#FFEDEDED" StrokeThickness="1" Stroke="#FFA3A3A3" Opacity="0.7" 
                VerticalAlignment="Center" HorizontalAlignment="Center"
                Data="m 1 2 l 4.0525 5.2361 l 4.0527 -5.2361 z" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...