wpf简单的绕圈进度条(无cs代码)(代码片段)

lonelyxmas lonelyxmas     2022-11-12     799

关键词:

方案: 图标位置不变化的情况下设置透明度实现

技术分享图片

代码:

<Window
    x:Class="WpfApp1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ec="http://schemas.microsoft.com/expression/2010/controls"
    xmlns:local="clr-namespace:WpfApp1"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="MainWindow"
    Width="300"
    Height="300"
    mc:Ignorable="d">

    <Window.Resources>
        <Duration x:Key="AnimationTime">0:0:.84</Duration>
    </Window.Resources>
    <Grid Background="Gray">
        <Ellipse
            x:Name="ellipse"
            Width="80"
            Height="80"
            RenderTransformOrigin="0.5,0.5" />
        <ec:PathListBox HorizontalAlignment="Left" VerticalAlignment="Top">
            <ec:PathListBox.LayoutPaths>
                <ec:LayoutPath Distribution="Even" SourceElement="Binding ElementName=ellipse" />
            </ec:PathListBox.LayoutPaths>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:.770"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:.700"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:.630"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:.560"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:.490"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:.420"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:.350"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:0.280"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:0.210"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:0.140"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:0.7"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
            <Ellipse
                Width="15"
                Height="15"
                Fill="White">
                <Ellipse.Triggers>
                    <EventTrigger RoutedEvent="Window.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    BeginTime="0:0:0"
                                    RepeatBehavior="Forever"
                                    Storyboard.TargetProperty="Opacity"
                                    From=".2"
                                    To="1"
                                    Duration="StaticResource AnimationTime" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Ellipse.Triggers>
            </Ellipse>
        </ec:PathListBox>
    </Grid>
</Window>

 

wpf自定义绕圈进度条(转)

在设计界面时,有时会遇到进度条,本次讲解如何设计自定义的绕圈进度条,直接上代码: 1、控件界面<UserControlx:Class="ProgressBarControl"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/wi 查看详情

wpf客户端浏览器添加loading加载进度(代码片段)

...加载进度显示界面显示1.界面显示,加载进度样式可参考:绕圈进度条2.添加Loading状态枚举。不加载/ 查看详情

wpf实现圆形进度条(代码片段)

 WPF实现圆形进度条控件名:CircularProgressBar作 者:WPFDevelopersOrg-驚鏵原文链接[1]:https://github.com/WPFDevelopersOrg/WPFDevelopers框架使用.NET40;VisualStudio2019;CircularProgressBar继承ProgressB 查看详情

wpf2个datagrid之间同步进度条(代码片段)

页面代码<GridDockPanel.Dock="Left"Width="400"><DataGridName="dgSource"VerticalScrollBarVisibility="Visible"EnableRowVirtualization="False"ScrollViewer.ScrollChanged="DgSource_ScrollChanged">&l 查看详情

wpf多线程进度条更新进度(代码片段)

...ializeComponent();//启动后,检查下载更新文件//同时更新进度条Task.Run(()=>f 查看详情

cssreactjs的简单进度条(代码片段)

查看详情

photoshop和wpf双剑配合,打造炫酷个性的进度条控件(代码片段)

原文:Photoshop和WPF双剑配合,打造炫酷个性的进度条控件现在如果想打造一款专业的App,UI的设计和操作的简便性相当重要。UI设计可以借助Photoshop或者AI等设计工具,之前了解到WPF设计工具ExpressionBlend可以直接导入PSD文件或者AI设... 查看详情

wpf水波进度条用户控件(代码片段)

之前看公司web前端做了个圆形的水波纹进度条,就想用wpf做一个,奈何自己太菜一直做不出来,在看过“普通的地球人”的“WPF实现三星手机充电界面 博客之后我也来照葫芦画个瓢。废话不多说先贴一下效果图虽然... 查看详情

unity简单的进度条实现(代码片段)

制作进度条所需的资源:用以载入进度条显示的场景进度条背景以及进度条本身(颜色区别)展示百分制进度情况的Text文本需要载入的场景(这里使用的是自带场景)载入时的场景布局:要将Load的ImageType修改为Filled,FillMethod修... 查看详情

记录小文件上传的几个例子(含进度条效果,附源码下载)(代码片段)

1、简单原生上传无javascript脚本、无进度条;借助iframe实现post提交后的无刷新效果;jquery插件ajaxFileUpload.js的实现原型。Html代码<formenctype="multipart/form-data"action="UploadFile_1"method="post"target="frameResult"><divclass="ite 查看详情

简单进度条(代码片段)

  UserControlx:Class="WpfApplication1.UserControl2"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://sch 查看详情

asp.net的一个简单进度条功能(代码片段)

...显示进度页面,进度完成后,进度条消失,其实也是比较简单的了。我们需要一个进度条代码文件ProgressBar.htm(注意:是没有head这些标签的) <scriptlanguage="javascript">functionSetPorgressBar(pos)//设置进度条居中varscreenWidth=documen... 查看详情

2021-08-14wpf控件专题progressbar控件详解(代码片段)

1.ProgressBar控件介绍进度条:显示某个操作的进度过程。MaximumMinimumOrientationValueIsIndeterminate2.具体案例<Grid><!--Orientation进度条的方向默认水平IsIndeterminate指示进度是显示实际值true连续进度反馈--><ProgressBarHorizontalAli 查看详情

shell实现简单的进度条(代码片段)

实现printf的有色输出:参考链接实现代码:#!/bin/bashlabel=('|''/''-''\\\\')str=''str1=''str2=''k=0#表示百分比进度foriin1..100do str+=& 查看详情

androidprogressbar(进度条)的简单使用(代码片段)

圆形进度条只需要加入ProgressBar,默认即是圆形xml文件<LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical">< 查看详情

设计进度条(代码片段)

...设计,才能让原本的蓝灰配变得更加“灵动”一些哈!最简单的进度条,源码是这样的:<progressid="pro"value="30"></progress>最简单的呈现效果,没有加一点儿修饰的样子是这样的:怎么说呢?就像是被人打了一样,很木,很... 查看详情

ruby使用ruby的没有gem的简单进度条脚本。(代码片段)

查看详情

wpf通过线程使用processbar(代码片段)

WPF下使用进度条也是非常方便的,如果直接采用循环然后给ProcessBar赋值,理论上是没有问题的,不过这样会卡主主UI线程,我们看到的效果等全部都结束循环后才出现最后的值。所以需要采用线程或者后台方式给进度条赋值的方... 查看详情