WPF复制将Regular Polygon混合到应用程序中

时间:2013-12-07 15:32:19

标签: c# wpf xaml

我在Blend 2012中创建了一个带三角形的椭圆。我将xaml复制到我的WPF应用程序中。但是我收到错误消息“命名空间http://schemas.microsoft.com/expression/2010/drawing中不存在名称RegularPolygon。缺少什么?

   <Application x:Class="WpfSimulator.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" 
         StartupUri="MainWindow.xaml">
<Application.Resources>

 <ed:RegularPolygon HorizontalAlignment="Left" Height="32" InnerRadius="1" Margin="29,14,0,0" PointCount="3" Stretch="Fill" Stroke="Black" StrokeThickness="0" VerticalAlignment="Top" Width="37" RenderTransformOrigin="0.5,0.5">
        <ed:RegularPolygon.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform Angle="90.492"/>
                <TranslateTransform/>
            </TransformGroup>
        </ed:RegularPolygon.RenderTransform>
        <ed:RegularPolygon.Fill>
            <RadialGradientBrush RadiusY="1.241" RadiusX="0.611">
                <GradientStop Color="#FF1F1FD8"/>
                <GradientStop Color="White" Offset="1"/>
            </RadialGradientBrush>
        </ed:RegularPolygon.Fill>
    </ed:RegularPolygon>

1 个答案:

答案 0 :(得分:6)

您应该添加对程序集Microsoft.Expression.Drawing的引用。 像这样: enter image description here