What's the difference between StaticResource and DynamicResource in WPF?

前端 未结 8 2021
长发绾君心
长发绾君心 2020-11-22 12:33

When using resources such as brushes, templates and styles in WPF, they can be specified either as StaticResources



        
8条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 13:15

    Important benefit of the dynamic resources

    if application startup takes extremely long time, you must use dynamic resources, because static resources are always loaded when the window or app is created, while dynamic resources are loaded when they’re first used.

    However, you won’t see any benefit unless your resource is extremely large and complex.

提交回复
热议问题