响应UI提示 [英] Responsive UI Tips

查看:223
本文介绍了响应UI提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想几个小技巧,当我想创建一个负责任的UI



我知道如何使用:

 调度
任务
BackgroundWorker的
线程

我要寻找更高级的技巧,像结合的技巧...当我有我的用户界面,需要更新50+控制。

  PriorityBinding 
填充组合框
填充列表框,列表视图

当在后台...
最佳实践处理数据也许当谈到长期运行proccess。



我可以做什么呢。让我的UI 100%响应


解决方案

  1. FastObservableCollection


  2. 操纵<一个HREF =htt​​p://msdn.microsoft.com/en-us/library/system.windows.presentationsource.aspx相对=nofollow> PresentationSource


  3. 在多线程应用 PLINQ 或Linq的使用
    AsQueryable已()比单一数据源的动态过滤线程和线程无关的CollectionView


  4. 现成的照片与图像过动画


  5. 非虚拟化的面板像画布

    虚拟化技术的


  6. 递延滚动


  7. 触发.Exnter \的动画退出操作。


  8. BeginStoryboard.HandoffBehavior =撰写


  9. 使用硬件对软件加速。


  10. 避免 WindowStyle =无 ALLOWTRANSPARENCY = TRUE 背景=透明 TILEMODE


  11. 配置 RenderOptions.BitmpaScalingMode 作为LowQuality并启用缓存。启用 PresentationFontCache Windows服务。


  12. 使用 Staticresources Dynamicresources


  13. 避免继承依赖属性。此外,还要避免重操作改变性质回调。


  14. 使用可冻结刷。避免 X:名称 / Namescoping / 绑定他们颜色 propertys他们是可冻结所有的时间。


  15. 设置边框的背景下,如果它封装了一个视觉比设定的视觉背景。类似的是,如果你设置了一个作为背景视觉然后指定 Brush.Opacity Visual.Opacity


  16. 值转换器必须有minimulistic代码。使用 Binding.IsAsync PriorityBinding (如适用)。


  17. 使用扩展器 IsExpanded =假默认情况下。


  18. 在每个渲染周期

    CompositionTarget.Rendering 火灾等等,应仅在必要时使用。 Detatch它的任何机会。


  19. WPF 的DataGrid 应避免大量使用组合框列和编辑模板列作为combobx模板尝试加载所选的值,并通过实际从具有高度可观察到的集合使用时的每个组合框和模板列漏的项目源搜索用它显示件路径。


  20. 使用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.

解决方案

  1. FastObservableCollection

  2. Manipulating PresentationSource

  3. Using PLinq or Linq on multiple threads by using AsQueryable() for dynamic filtering of data sources than single threaded and thread agnostic CollectionView.

  4. Readymade Gifs over animation

  5. Vitualization of non-virtualized panels like canvas

  6. Deferred scrolling

  7. Trigger.Exnter \ Exit Actions for animations.

  8. BeginStoryboard.HandoffBehavior="Compose"

  9. Using Hardware over software acceleration.

  10. Avoiding WindowStyle=None, AllowTransparency=true, Background=Transparent, TileMode

  11. Configure RenderOptions.BitmpaScalingMode as LowQuality and enable caching. Enable PresentationFontCache windows service.

  12. Use Staticresources over Dynamicresources

  13. Avoid inheritable dependency properties. Also avoid heavy operations in property changed call backs.

  14. Use Freezable brushes. Avoid x:Name / Namescoping / Binding to their Color propertys them to be freezable all the time.

  15. 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 specify Brush.Opacity than Visual.Opacity.

  16. Value converters must have minimulistic code. use Binding.IsAsync and PriorityBinding wherever applicable.

  17. Use Expanders with IsExpanded=False by default.

  18. CompositionTarget.Rendering fires on each rendering cycle so should be used only if required. Detatch it on any opportunity.

  19. 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.

  20. Use WPF Extedned Tooklit based Shader effects and New Pixel Shader APIs such as Blur, Shadow.

And Many more...

这篇关于响应UI提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆