silverlight 4.0 - Silverlight4 WebContext -


i have built silverlight 4 application , have hit problem.

i have split application multiple xaps(different sub-systems) reduce downloading / improve performance not subsystems needed every user.

however want share webcontext between xaps, rather authenticating again , setting webcontext each xap.

is possible? if how can achieve it?

you need share library applications. so, let's assume have 3 xap projects called project1.xap, project2.xap, , project3.xap. these projects should reference silverlight class library has shared logic. in shared project, can create interface that's implemented root application. let's call iapplicationcontext.

the root application xap file loads other xaps. let's call root.xap. 1 manage authentication , create implementation of iapplicationcontext pass other xaps upon creation.

// available projects (shared.dll) public interface iapplicationcontext {     string username { get; }     guid sessionid { get; }     // ... }  // implemented in root application (root.xap) public class myappcontext : iapplicationcontext {     public string username { get; private set; }     public guid sessionid { get; private set; }     // ... } 

you can share between applications, , keep separate projects testable because can stub/mock iapplicationcontext.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -