目标是显示应用程序正在运行的信息。因此,我正在寻找使用 WPF / MVVM 的加载旋转器的智能实现示例。
一个非常简单的“即插即用”旋转器可能是来自Font Awesome Wpf 包 https://github.com/charri/Font-Awesome-WPF (旋转的图标 https://github.com/charri/Font-Awesome-WPF/blob/master/README-WPF.md#spinning-icons).
使用方法非常简单,安装nuget包即可:
PM> Install-Package FontAwesome.WPF
然后添加对命名空间的引用
xmlns:fa="http://schemas.fontawesome.io/icons/"
并使用 ImageAwesome 控件。设置 Spin="True" 属性并选择“Spinner”、“Refresh”、“Cog”和“CircleOutlinedNotched”图标之一。它是可扩展的,可以通过设置宽度和高度来调整大小。
<Window x:Class="Example.FontAwesome.WPF.Single"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fa="http://schemas.fontawesome.io/icons/"
Title="Single" Height="300" Width="300">
<Grid Margin="20">
<fa:ImageAwesome Icon="Refresh" Spin="True" Height="48" Width="48" />
</Grid>
</Window>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)