ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Which Two types of Logical Resources available in WPF?

- StaticResource and Dynamic Resource- StaticResource and CompileResource- WPF does not support Logical Resources- None of the above

user-image
تم إضافة السؤال من قبل Mohannad Bakbouk , Full Stack Web Developer , Almohtaseb
تاريخ النشر: 2016/10/19
Mohamed Ahmed Mansour
من قبل Mohamed Ahmed Mansour , Technical Director & Implementation Head , United Quality Information Systems

  • Logical resources are of two types :

    1) StaticResources 

       * StaticResource is applied only once (first time when it is used).

      * StaticResource has lesser overhead as it is applied only once during the runtime of the       application.

      * StaticResources always get loaded the first time window/page is loaded irrespective of       its use during start up.

      * StaticResources can be used for DependencyProperty as well as normal .net property.

      * StaticResources has to be defined before it is used. Hence, StaticResources can not be      forward referenced.

    2) DynamicResources

        * DynamicResource is applied every time when resource changes e.g. system colors can be         changed using control panel. So if system colors has been used as resource, than update is       required. DynamicResource will take care of such change in resource.

                 * DynamicResource has more overhead as it is applied whenever the resource value                  changes. In order to do this, DynamicResource has to keep tracking about the                        changes in the resource during runtime also.

             * DynamicResources are not loaded until it is actually used. So this results in better                 load time.

            * DynamicResource can only be used for DependencyProperty.

            * DynamicResources can use the forward references.

المزيد من الأسئلة المماثلة