WPF 使用 Expression.Controls和Expression.Drawing绘制圆形刻度盘

 <ec:PathListBox x:Name="numberPathListBox"
                                    IsHitTestVisible="False">
                        <ec:PathListBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Foreground="White"
                                           Text="{Binding}"
                                           FontSize="15">

                                </TextBlock>
                            </DataTemplate>
                        </ec:PathListBox.ItemTemplate>
                        <ec:PathListBox.LayoutPaths>
                            <ec:LayoutPath Distribution="Even"
                                           Orientation="OrientToPath"
                                           SourceElement="{Binding ElementName=NumberPath}" />
                        </ec:PathListBox.LayoutPaths>
                    </ec:PathListBox>
 <ed:Arc x:Name="NumberPath"
                            Margin="18"
                            ArcThickness="0"
                            ArcThicknessUnit="Pixel"
                            StartAngle="0"
                            EndAngle="350"
                            Stretch="None" />

效果图:

 

源码下载:

https://files.cnblogs.com/files/chlm/%E5%9C%86%E5%BD%A2%E7%9B%98.rar

posted @ 2020-04-18 15:07  灰主流  阅读(752)  评论(0编辑  收藏  举报