开发者

How to create a xap per user control?

I'm not sure what is recommended for using xap files in an A开发者_C百科SP.NET web application, but it seems like a bad idea to stuff all of ones silverlight user controls into a single project in order to produce a single xap file. The XAP file could become large in size and if I only want a single user control I wouldn't want to load all of the user controls. So, how is it possible to create a xap file per user control? Is there a better way than this or this? Thanks!


When a XAP becomes a very large download it might be wise to split it up and download other XAPs (or DLLs) when needed. This would speed up the initial download and start up.

One way of splitting the application is by defining multiple areas of the application that will used by different users/roles. that way a user will only download those parts that the user will use.

Another way of partitioning is by defining areas that most users will use and packaging all other areas separately. This way most users will be able to use all general/frequently used parts of the application without downloading too much, while special functionality will come with a (tiny?) penalty.

What scheme will fit your application and users depends on the application.

Prism is a framework that could help you to set up the structure of the application and could take care of most of the plumbing to get this working.

Have a look at Prism and modules here


You would not have a xap file for each control. A xap file is basically a zip file with all your required assembles. Theres no reason not to put all your user controls in one assembly, download size will still be minimal because each user control is only a xaml and a code behind file. You should only really start worrying about xap size if you are embedding media items such as images and audio.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜