开发者

Nothing displayed when set a line to DashStyles.Dot


<DockPanel LastChildFill="True" Height="18">
<Imag开发者_JAVA技巧e Height="18" Width="80">
    <Image.Source>
        <DrawingImage>
            <DrawingImage.Drawing>
                <GeometryDrawing Brush="Black">
                    <GeometryDrawing.Geometry>
                        <LineGeometry StartPoint="0,9" EndPoint="38,9" />
                    </GeometryDrawing.Geometry>
                    <GeometryDrawing.Pen>
                        <Pen DashCap="Flat"
                             Brush="Black"
                             Thickness="0.5"
                             DashStyle="{x:Static DashStyles.Dot}, Mode=OneTime}"
                         />
                    </GeometryDrawing.Pen>
                </GeometryDrawing>
            </DrawingImage.Drawing>
        </DrawingImage>
    </Image.Source>
</Image>
<TextBlock Height="18" Text="{Binding Name, Mode=OneTime}" Margin="3,2,5,0" />
</DockPanel>


Remove DashCap="Flat" and you will see the dots. There are other DashCaps that will work: Round, Square, Triangle.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜