WPF进度条系列①滑动小圆点
写在之前:
关于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进度条系列①滑动小圆点的更多相关文章
- WPF进度条系列②旋转小圆圈
写在之前: 关于WPF的样式,我也是学习了很多朋友的文章才有了下面的东西,因为时间有些久远 & 备份的链接也都不在了. 所以,究竟是看过哪些文章,也是记不清楚了…… 请见谅. ------- ...
- 疯狂JAVA讲义---第十二章:Swing编程(五)进度条和滑动条
http://blog.csdn.net/terryzero/article/details/3797782 疯狂JAVA讲义---第十二章:Swing编程(五)进度条和滑动条 标签: swing编程 ...
- WPF 进度条ProgressBar
今天研究了一下wpf的进度条ProgressBar 1.传统ProgressBar WPF进度条ProgressBar 这个控件,如果直接写到循环里,会死掉,界面会卡死,不会有进度.需要把进度条放到单 ...
- 使用原生JS+CSS或HTML5实现简单的进度条和滑动条效果(精问)
使用原生JS+CSS或HTML5实现简单的进度条和滑动条效果(精问) 一.总结 一句话总结:进度条动画效果用animation,自动效果用setIntelval 二.使用原生JS+CSS或HTML5实 ...
- WPF进度条
ProgressBar控件与传统WinForm使用方法完全一样,我们只需关注: Minimum——最小值,默认为0: Maximum——最大值,默认为100. Value——当前值. 关键是它的控 ...
- 继续聊WPF——进度条
ProgressBar控件与传统WinForm使用方法完全一样,我们只需关注: Minimum——最小值,默认为0: Maximum——最大值,默认为100. Value——当前值. 关键是它的控 ...
- C# WPF 进度条,根据读取数据显示进度条进度,根据Excel文件读取数据,进度条样式
后台代码: //导入 private void Border_MouseLeftButtonUp_2(object sender, MouseButtonEventArgs e) { var path ...
- wpf 进度条 下拉
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsof ...
- 第三方MMDrawerController的使用 抽屉视图+(SUNSlideSwitchView)进度条手势滑动效果实现
下载网站:https://github.com/mutualmobile/MMDrawerController 首先,到下载网址下载MMDrawerController,将文件导入工程,里面有: MM ...
随机推荐
- windows防火墙命令
删除防火墙:netsh advfirewall firewall delete rule name=%gate_rule_name% 添加防火墙:netsh advfirewall firewall ...
- [To do]Appx Package installed, can't start at first time
When installed partition tool & mkrcvcd as windows store app. it can't start at first time. the ...
- 【转】使用Reflector和FileDisassembler反编译成项目文件
转载地址:http://blog.csdn.net/nuaalfm/article/details/2089149 FileDisassembler是Reflector 的一个插件,老外做的东西还真好 ...
- ZooKeeper测试笔记
1. 下载ZooKeeper.官网:http://zookeeper.apache.org 下载后解压,假定zookeeper程序目录为/home/test/zookeeper,为陈述方便此目录记为 ...
- Mybatis-Spring集成
MyBatis-Spring用来将MyBatis无缝整合到Spring中.使用这个类库中的类, Spring将会加载必要的MyBatis工厂类和Session类. 这个类库也提供一个简单的方式来注入 ...
- 一篇说尽Excel常见函数用法
一篇说尽Excel常见函数用法 Word,PPT,Excel这三个Office软件是职场办公里最常用的三个软件,但是我发现简书上写PPT的教程多,Excel的少,即使有,也是零零散散.因为Excel的 ...
- mysql实战之 批量update
mysql实战之批量update 现阶段我们的业务量很小,要对admin_user表中的relationship字段进行更新,指定id是409.已知409是公司内的一服务中心,需要把该服务中心放到区代 ...
- CSS样式表(三)
前端人员在学习开发过程中常用的CSS样式总结: [margin] margin 检索或设置对象四边的外延边距 margin-top 检索或设置对象顶边的外延边距 margin-right 检索或设置对 ...
- Bootstrap_Javascript
弹窗 一. 结构分析 Bootstrap框架中的模态弹出框,分别运用了“modal”.“modal-dialog”和“modal-content”样式,而弹出窗真正的内容都放置在“modal-cont ...
- jQuery实践——属性和css篇
属性: attr html:<div>demo1</div> jQuery:$("div").attr("id","demo1 ...