响应UI提示 [英] Responsive UI Tips
问题描述
我只是想几个小技巧,当我想创建一个负责任的UI
我知道如何使用:
调度
任务
BackgroundWorker的
线程
我要寻找更高级的技巧,像结合的技巧...当我有我的用户界面,需要更新50+控制。
PriorityBinding
填充组合框
填充列表框,列表视图
当在后台...
最佳实践处理数据也许当谈到长期运行proccess。
我可以做什么呢。让我的UI 100%响应
-
操纵<一个HREF =http://msdn.microsoft.com/en-us/library/system.windows.presentationsource.aspx相对=nofollow> PresentationSource
-
在多线程应用 PLINQ 或Linq的使用
AsQueryable已()比单一数据源的动态过滤线程和线程无关的CollectionView
。 -
现成的照片与图像过动画
- 非虚拟化的面板像画布
虚拟化技术的
-
递延滚动
-
触发.Exnter \的动画退出操作。
-
BeginStoryboard.HandoffBehavior =撰写
-
使用硬件对软件加速。
-
避免
WindowStyle =无
,ALLOWTRANSPARENCY = TRUE
,背景=透明
,TILEMODE
-
配置
RenderOptions.BitmpaScalingMode
作为LowQuality并启用缓存。启用PresentationFontCache
Windows服务。 -
使用
Staticresources
在Dynamicresources
-
避免继承依赖属性。此外,还要避免重操作改变性质回调。
-
使用可冻结刷。避免
X:名称
/Namescoping
/绑定
他们颜色
propertys他们是可冻结所有的时间。 -
设置边框的背景下,如果它封装了一个视觉比设定的视觉背景。类似的是,如果你设置了一个
刷
作为背景视觉然后指定Brush.Opacity
比Visual.Opacity
。 -
值转换器必须有minimulistic代码。使用
Binding.IsAsync
和PriorityBinding
(如适用)。 -
使用
扩展器
与IsExpanded =假
默认情况下。 - 在每个渲染周期
CompositionTarget.Rendering
火灾等等,应仅在必要时使用。 Detatch它的任何机会。 -
WPF
的DataGrid
应避免大量使用组合框列和编辑模板列作为combobx模板尝试加载所选的值,并通过实际从具有高度可观察到的集合使用时的每个组合框和模板列漏的项目源搜索用它显示件路径。 -
使用WPF Extedned工具包创建基于着色效果和新的像素着色器的API
,如模糊,阴影。
还有更多...
I would just like a few tips when i want to create a responsive UI.
I know how to use:
Dispatcher
Task
BackgroundWorker
Threads
I am looking for more advance tips, like binding tips... When i have 50+ controls on my UI that needs to update.
PriorityBinding
Populating ComboBoxes
Populating ListBoxes, ListViews
When processing data in the background... Best practices maybe when it comes to long running proccess.
What else can i do to make my UI 100% responsive.
Manipulating PresentationSource
Using PLinq or Linq on multiple threads by using AsQueryable() for dynamic filtering of data sources than single threaded and thread agnostic
CollectionView
.Readymade Gifs over animation
Vitualization of non-virtualized panels like canvas
Deferred scrolling
Trigger.Exnter \ Exit Actions for animations.
BeginStoryboard.HandoffBehavior="Compose"
Using Hardware over software acceleration.
Avoiding
WindowStyle=None
,AllowTransparency=true
,Background=Transparent
,TileMode
Configure
RenderOptions.BitmpaScalingMode
as LowQuality and enable caching. EnablePresentationFontCache
windows service.Use
Staticresources
overDynamicresources
Avoid inheritable dependency properties. Also avoid heavy operations in property changed call backs.
Use Freezable brushes. Avoid
x:Name
/Namescoping
/Binding
to theirColor
propertys them to be freezable all the time.Set background of the border, if it encapsulates a visual than setting visual's background. Similar is if you have set a
Brush
as background of a visual then specifyBrush.Opacity
thanVisual.Opacity
.Value converters must have minimulistic code. use
Binding.IsAsync
andPriorityBinding
wherever applicable.Use
Expanders
withIsExpanded=False
by default.CompositionTarget.Rendering
fires on each rendering cycle so should be used only if required. Detatch it on any opportunity.WPF
DataGrid
should avoid heavy use of combobox columns and editable Template columns, as the combobx templates try to load selected value and use the display member path by actually searching it from the items source of each combobox and template columns leak when used with highly observable collections.Use WPF Extedned Tooklit based Shader effects and New Pixel Shader APIs such as Blur, Shadow.
And Many more...
这篇关于响应UI提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!