写在之前:

关于WPF的样式,我也是学习了很多朋友的文章才有了下面的东西,因为时间有些久远 & 备份的链接也都不在了。

所以,究竟是看过哪些文章,也是记不清楚了……

请见谅。

--------------------------------我是害羞的分割线-----------------------------------

先看一下效果吧……

主要是xaml,因为ProssBar基本上市公用的,所以封装成一个控件:

<UserControl x:Class="AppHost.ProBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="20" d:DesignWidth="500" Background="Transparent">
<UserControl.Resources>
<Storyboard x:Key="StoryLeftToRight" RepeatBehavior="Forever">
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="e1" Storyboard.TargetProperty="(FrameworkElement.Margin)">
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="30,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:00.6" Value="225,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:03.1" Value="275,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:03.7" Value="500,0,0,0"/>
</ThicknessAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="e2" Storyboard.TargetProperty="(FrameworkElement.Margin)">
<SplineThicknessKeyFrame KeyTime="00:00:00.5" Value="20,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:01.1" Value="225,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:03.6" Value="275,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:04.2" Value="490,0,0,0"/>
</ThicknessAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="e3" Storyboard.TargetProperty="(FrameworkElement.Margin)">
<SplineThicknessKeyFrame KeyTime="00:00:01.0" Value="10,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:01.6" Value="225,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:04.1" Value="275,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:04.7" Value="480,0,0,0"/>
</ThicknessAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="e4" Storyboard.TargetProperty="(FrameworkElement.Margin)">
<SplineThicknessKeyFrame KeyTime="00:00:01.5" Value="0,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:02.1" Value="225,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:04.5" Value="275,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:05.2" Value="470,0,0,0"/>
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
<Style x:Key="EllipseLeftStyle" TargetType="Ellipse">
<Setter Property="Width" Value="4"/>
<Setter Property="Height" Value="4"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Fill" Value="#FF2CB6E7"/>
</Style>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource StoryLeftToRight}"/>
</EventTrigger>
</UserControl.Triggers>
<Grid>
<Ellipse Style="{StaticResource EllipseLeftStyle}" Margin="30,0,0,0" Name="e1"/>
<Ellipse Style="{StaticResource EllipseLeftStyle}" Margin="20,0,0,0" Name="e2"/>
<Ellipse Style="{StaticResource EllipseLeftStyle}" Margin="10,0,0,0" Name="e3"/>
<Ellipse Style="{StaticResource EllipseLeftStyle}" Margin="0,0,0,0" Name="e4"/>
</Grid>
</UserControl>

在使用中的时候直接在 xaml中写:

<local:ProBar x:Name="proBar"  HorizontalAlignment="Center"  VerticalAlignment="Center" Width="507"/>

local是Probar所在NameSpacce.

WPF进度条系列①滑动小圆点的更多相关文章

  1. WPF进度条系列②旋转小圆圈

     写在之前: 关于WPF的样式,我也是学习了很多朋友的文章才有了下面的东西,因为时间有些久远 & 备份的链接也都不在了. 所以,究竟是看过哪些文章,也是记不清楚了…… 请见谅. ------- ...

  2. 疯狂JAVA讲义---第十二章:Swing编程(五)进度条和滑动条

    http://blog.csdn.net/terryzero/article/details/3797782 疯狂JAVA讲义---第十二章:Swing编程(五)进度条和滑动条 标签: swing编程 ...

  3. WPF 进度条ProgressBar

    今天研究了一下wpf的进度条ProgressBar 1.传统ProgressBar WPF进度条ProgressBar 这个控件,如果直接写到循环里,会死掉,界面会卡死,不会有进度.需要把进度条放到单 ...

  4. 使用原生JS+CSS或HTML5实现简单的进度条和滑动条效果(精问)

    使用原生JS+CSS或HTML5实现简单的进度条和滑动条效果(精问) 一.总结 一句话总结:进度条动画效果用animation,自动效果用setIntelval 二.使用原生JS+CSS或HTML5实 ...

  5. WPF进度条

    ProgressBar控件与传统WinForm使用方法完全一样,我们只需关注: Minimum——最小值,默认为0: Maximum——最大值,默认为100. Value——当前值.   关键是它的控 ...

  6. 继续聊WPF——进度条

    ProgressBar控件与传统WinForm使用方法完全一样,我们只需关注: Minimum——最小值,默认为0: Maximum——最大值,默认为100. Value——当前值.   关键是它的控 ...

  7. C# WPF 进度条,根据读取数据显示进度条进度,根据Excel文件读取数据,进度条样式

    后台代码: //导入 private void Border_MouseLeftButtonUp_2(object sender, MouseButtonEventArgs e) { var path ...

  8. wpf 进度条 下拉

    <Window x:Class="WpfApplication1.MainWindow"        xmlns="http://schemas.microsof ...

  9. 第三方MMDrawerController的使用 抽屉视图+(SUNSlideSwitchView)进度条手势滑动效果实现

    下载网站:https://github.com/mutualmobile/MMDrawerController 首先,到下载网址下载MMDrawerController,将文件导入工程,里面有: MM ...

随机推荐

  1. 【ASM C/C++】 Makefile 规则说明

    make 命令会自动读取当前目录下的 Makefile 文件[31],完成相应的编译步骤.Makefile 由一组规则(Rule)组成,每条规则的格式是:target ... : prerequisi ...

  2. Git使用指南(3)—— 使用Git命令

    暂存区替换掉工作区 git init git init newrepo 克隆仓库 git clone git clone <repo> git clone <repo> < ...

  3. Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) B

    Description Santa Claus decided to disassemble his keyboard to clean it. After he returned all the k ...

  4. easyui-window 关闭事件,只要关闭窗口就会触发

    $(function () {            $('#windowsMSG').window({                onBeforeClose: function () { //当 ...

  5. .dtsi .dts dtc dtb 是什么

    基础 .dts: device tree source .dtsi:   device tree source include .dts比作源文件,.dtsi比作头文件. dtc是linux源码 /s ...

  6. linux驱动中printk的使用注意事项

    今天在按键驱动中增加printk(KERN_INFO "gpio_keys_gpio_isr()\n");在驱动加载阶段可以输出调试信息,但驱动加载起来后的信息,在串口端看不到输出 ...

  7. Python的SublimeText开发环境配置

    1.完成Python的默认安装之后要设置环境变量,系统环境变量Path中加入Python的安装目录";C:/Python27" 2.配置Python编译环境,修改[C:\Progr ...

  8. php set_time_limit()用法测试详解

    在php中set_time_limit函数是用来限制页面执行时间的,如我想把一个php页面的执行时间定义为5秒就可以set_time_limit(5)了.   一个php脚本通过crontab每5分钟 ...

  9. 在Linux中查看所有正在运行的进程

    可以使用ps命令.它能显示当前运行中进程的相关信息,包括进程的PID.Linux和UNIX都支持ps命令,显示所有运行中进程的相关信息. ps命令能提供一份当前进程的快照.如果想状态可以自动刷新,可以 ...

  10. IE11 HTML Help ActiveX

    <!--by: @qab--> <OBJECT id=HHCTRL type="application/x-oleobject" classid="cl ...