1

I currently have a C# ASP.NET web forms web application that is maybe 2% Silverlight (4 or 5 xaml views). Our team has decided that for the next version we need to use Silverlight more for video streaming as well as CRUD operations. We have a Silverlight project and a single xap file to compliment the ASP.NET site. I would like to start using Silverlight for all new views and slowly convert existing aspx views over to Silverlight. The way we currently load the Silverlight views is by passing in a view name as a property like so:

 <div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," 
        type="application/x-silverlight-2" width="100%" height="100%">
          <param name="source" value="ClientBin/Superuser.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="background" value="white" />
          <param name="minRuntimeVersion" value="4.0.50826.0" />
          <param name="autoUpgrade" value="true" />
          <param name="initParams" value="startPage=AQ" />
          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" 
              style="text-decoration:none">
              <img src="http://go.microsoft.com/fwlink/?LinkId=161376" 
              alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
        </object><iframe id="_sl_historyFrame" style="visibility:hidden;
        height:0px;width:0px;border:0px"></iframe></div>

By using: <param name="initParams" value="startPage=AQ" /> (AQ.xaml) I can load any view I want. Is this a good strategy to use for migrating? What is a better way to do this?

Thanks!

1

1 Answer 1

2

Learn more about Prism and Unity for Silverlight it's realy great thing when you need create internet application Prism and Mike Taulty Video Series Prevent me from reinventing and save a lot of time.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks! I have created a simple Prism test app before and it's great, but a little confusing. However, can you elaborate as to why this would be a good migration strategy?
I think it help you create a good base for new application. In example in aps.net you probably have a master page, themas and custom user controls, in silverlithg you can have only one aspx page which host silverligth module and load many business views by MEF. I see one project with mixed paradigms - pages and webprats which host silverlight modules it looks really awful.
Yes you are correct, the way the app is currently is very messy. There are many instances where the silverlight portion will be only a single user control with no navigation to other parts of the silverlight app. Does MEF take care of this too? I don't want to end up with 30 xap files with a single view in each :).
MEF is a link in the chain 1)all project in VS2010 have setted "reduce xap file..." it divide xap for seperate zip files 2)all projects bulild to ClientBin folder; 3)browser hold project parts in local cache; 4)in main module you can force preload some libraries at startup; 5)use MEF to load other module by demand. NUGET helps to keep external dependencies fresh across the team.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.