定时器的UI控制器 [英] UI controller for timer
本文介绍了定时器的UI控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨。
我必须使用计数器构建一个简单的应用程序,并希望添加类似于Windows App Timer 10的图形计时器。
我应该使用什么控制?
样本
< img src =https://www.dropbox.com/s/ytcfj9h3yy765dv/Cattura.JPG? dl = 0alternative =Sample>
我的尝试:
我在WPF标准控件中找不到这样的东西
解决方案
在WPF中使用DispatchTimer - 参考教程 [ ^ ]这里
您要使用哪种控件? - 但不是关于如何实现计时器im WPF,对吗? (CHill60的链接很好)
忘记WPF中的控件,尽管有一些像Button或TextBox这样的默认值我很难使用它们 - 为什么? - 只需创建自己的模板,造型,构图或代码或任何你认为合适的东西。
从你在图片中显示的例子我会说:
创建一个带有一些布局面板(Grid)的UserControl和一些绑定到简单(ViewModel)属性的默认控件,或者如果你不将MVVM与一些DependencyProperties一起使用......
然后编写所需的简单子控件视图:
*一些或一个TextBlock当时
*动画圆(椭圆)或图形路径(看看任何WPF微调控件找到可能的方法如何做到这一点)
*一些特殊风格的按钮或只是图像...
*更多TextBlocks
多数民众赞成 - 这就是为什么默认的WPF-Control库如此简陋......几乎没有用它们的原因......
< blockquote>好的,我找到了这个解决方案。
如何进行条形微调器
哦飞!这是非常复杂的开发与标准不同的东西
感谢所有人。
Hi.
I have to build a simple app with a counter and wanted to add a graphic timer similar to that of Windows App Timer 10.
What control should I use?
Sample
<img src="https://www.dropbox.com/s/ytcfj9h3yy765dv/Cattura.JPG?dl=0" alternative="Sample">
What I have tried:
I don't have found anything like this in WPF standar controls
解决方案
Use DispatchTimer in WPF - reference tutorial[^] here
Which Control to use is your question? - but not about how to implement the timer im WPF, correct? (CHill60's link is good)
Forget about controls in WPF, despite a few Default ones like Button or TextBox i hardly use them - why? - just create your own with templating, Styling, composition or code or whatever you see fit.
From the example you showed in the picture I'd say:
Create an UserControl with some layout panel(Grid) and some default controls bound to simple (ViewModel)-properties, or if you don't use MVVM with some DependencyProperties...
Then compose the desired view of simple subcontrols:
* some or one TextBlock for the time
* animated circle (ellipse) or graphics-path (have a look at any WPF spinner Control to find possible ways how to do this)
* Some Buttons with Special style or just Images...
* Some more TextBlocks
Thats it - and this is the reason why the default WPF-Control library is so spartanic... there is hardly a use for them...
Ok, I have find this solution.
How to progress bar spinner
Oooh fly! It's very very complicated develop something different from the of standard
Thank's for all.
这篇关于定时器的UI控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文