Getting Started

The easiest way to start using the control is to get the new Visual Studio item template. You can get it from the Downloads page or better still - use the .vsix installer, it will add the template to Visual Studio automatically. After you have the Item Template, just click Add->New Item and choose the "CompletIT ClassifiedCabinet User Control". It will add to your Silverlight project a user control with a fully set ClassifiedCabinet. You can then add this user control to your application's main page or even set it as the root visual and you will have a functioning ClassifiedCabinet right away. It is that easy! To make it even easier to start using the control, the project is now available on NuGet. If you have NuGet, just type Install-Package ClassifiedCabinet and you're ready to use our control (and if you don't have NuGet yet - it's great, get it from nuget.org.)

API Reference

You can download full API reference in compiled HTML format. Just remember to unblock the file after you download it to allow it to run. Right-click on the file, select properties and then click "Unblock".

Articles

To help you start using this control we have prepared a number of articles published on SilverlightShow. More articles to come in the following weeks.

Using the Source Code

Classified Cabinet Control
After you download the ClassifiedCabinetSourceCode.zip file from the Downloads page, just extract it somewhere and open it with Visual Studio 2010. You should be able to build it and run the test right away. The ClassifiedCabinet project is the class library that actually contains the control. The other project – ClassifiedCabinet.Testing contains the unit tests. To be able to build and run it you need to have the Telerik.JustMock.Silverlight.dll assembly, which is included in this release and can be found in the Lib folder. Telerik.JustMock is freely available and if you want you can download and install it from http://www.telerik.com/products/mocking.aspx.
Bookshelf Sample
After downloading the Samples.zip file from the Downloads page, extract it somewhere and open it using Visual Studio 2010. The web project Bookshelf.Web should already be the start-up project and you should be able to build and run it immediately without any additional work. The project is setup to run with attached database and the actual database file is located in the web project under App_Data.
If you don't have a local instance of Micorsoft SQL Server Express or you want to use another database, you should change the connection string in the Web.config file accordingly. The .Net Entity Framework 4.0 was used so the connection string is in its specific format. For example, the current value is
<add name="BookshelfEntities" 
    connectionString="metadata=res://*/BookshelfEntities.csdl|res://*/BookshelfEntities.ssdl|res://*/BookshelfEntities.msl;provider=System.Data.SqlClient; provider connection string=&quot;Data Source=.\SQLEXPRESS;Integrated Security=true;AttachDbFilename=|DataDirectory|\Bookshelf.mdf;User Instance=true;&quot;"
    providerName="System.Data.EntityClient" />
but if you want to use it on your web server, you might want to change to something like this:
<add name="BookshelfEntities"
    connectionString="metadata=res://*/BookshelfEntities.csdl|res://*/BookshelfEntities.ssdl|res://*/BookshelfEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=<YourDataBase>;User ID=<YourUserID>;Password=<YourPassword>;MultipleActiveResultSets=True&quot;" 
    providerName="System.Data.EntityClient" />

There are few more settings in the Web.config, you might want to change. Right now the project is configured to run from localhost on port 49692. If you want to set it up to run on different server or port (for example if you want to run it from your web server), you have to change the following lines:
<appSettings>
    <add key="BookshelfService" value="http://localhost:49692/BookCategoriesDataService.svc/" />
    <add key="BookshelfWeb" value="http://localhost:49692" />
    <add key="BookshelfUploadImageHandler" value="http://localhost:49692/UploadImageHandler.ashx" />
</appSettings>
The values are later passed to the Silverlight application as initParams and are expected to be valid URI strings. The first one should be the URI of your data service. The second one is the base URI used to resolve the URIs of the images and the last is the URI of the handler used for uploading the images. Basically, you want to just replace the string "localhost:49692" with your domain for example "example.com" in all three cases. There is one last thing you need to change.
<services>
    <service name="Samples.Bookshelf.Web.BookCategoriesDataService">
        <endpoint address="http://localhost:49692/BookCategoriesDataService.svc" binding="webHttpBinding" contract="System.Data.Services.IRequestHandler" />
    </service>
</services>
Here again you have to change the "address" to be the URI of your data service – it's the same as above.

If you have any questions or want to share your opinion about the ClassifiedCabinet you're more than welcome to do so using the Discussions page. You can also send your feedback to feedback@completit.com.

Last edited Apr 12, 2011 at 12:32 PM by gstoyanov, version 12

Comments

No comments yet.