<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sharker Khaleed Mahmud&#039;s Blog</title>
	<atom:link href="http://sharkerkhaleedmahmud.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sharkerkhaleedmahmud.wordpress.com</link>
	<description>ASP.NET, MVC, BLEND, Silverlight, AJAX and JQuery</description>
	<lastBuildDate>Wed, 26 Oct 2011 15:44:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sharkerkhaleedmahmud.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0534170dfa129eac7f2e96bc049a9a6e?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Sharker Khaleed Mahmud&#039;s Blog</title>
		<link>http://sharkerkhaleedmahmud.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sharkerkhaleedmahmud.wordpress.com/osd.xml" title="Sharker Khaleed Mahmud&#039;s Blog" />
	<atom:link rel='hub' href='http://sharkerkhaleedmahmud.wordpress.com/?pushpress=hub'/>
		<item>
		<title>MVP Nomination May 2010</title>
		<link>http://sharkerkhaleedmahmud.wordpress.com/2010/05/09/mvp-nomination/</link>
		<comments>http://sharkerkhaleedmahmud.wordpress.com/2010/05/09/mvp-nomination/#comments</comments>
		<pubDate>Sun, 09 May 2010 04:15:17 +0000</pubDate>
		<dc:creator>Sharker Khaleed Mahmud &#124; shamrat231</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[MVP nomination]]></category>
		<category><![CDATA[Sharker Khaleed Mahmud]]></category>

		<guid isPermaLink="false">http://sharkerkhaleedmahmud.wordpress.com/?p=209</guid>
		<description><![CDATA[Hi all, I received an email from MSFT, Community Program Manager, Microsoft Corporation, India that if I would be interested in MVP Award. For those who are not familiar with the MVP program you can learn more by visiting our web site at: http://www.microsoft.com/india/mvp. However, the nomination for the MVP Program doesn’t guarantee the award:( [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=209&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p>Hi all,</p>
<p>I received an email from MSFT, Community Program Manager, Microsoft Corporation, India that if I would be interested in MVP Award. For those who are not familiar with the MVP program you can learn more by visiting our web site at: <a href="http://www.microsoft.com/india/mvp">http://www.microsoft.com/india/mvp</a>.</p>
<p>However, the nomination for the MVP Program doesn’t guarantee the award:(</p>
<p><span style="text-decoration:underline;">Q: What is the Microsoft MVP award?</span><br />
A: The MVP Award is an annual award that is given to outstanding members of Microsoft&#8217;s peer-to-peer communities, and is based on the past year&#8217;s contributions those members make in offline and online technical communities.</p>
<p><span style="text-decoration:underline;">Q: How does Microsoft award the MVPs?</span><br />
A: MVPs are awarded through a nomination period where their past year&#8217;s contributions to the technical community are compared against those of their peers. Recipients of the award are determined through review cycles in that nomination period.</p>
<p><span style="text-decoration:underline;">Q: Why does the award exist?</span><br />
A: Microsoft believes that a robust, interactive user community is key to helping customers maximize the solutions and benefits from their software investments. The MVP<br />
Award is the way Microsoft recognizes those participants who have made a highly positive impact in the technical and product communities in which they participate. Microsoft wants community participants and leaders to know that their contributions are greatly appreciated. The MVP Award exists as a way to reach out to and thank outstanding members for their past participation and willingness to help others in these communities, both online and offline.</p>
<p><span style="text-decoration:underline;">Q: What does the MVP Award include?</span><br />
A: The MVP Award includes designation as a Microsoft MVP, your own account manager (MVP Lead), a complimentary one-year subscription to MSDN or TechNet, and a certificate commemorating the award. Upon receipt of a voluntarily signed Non-Disclosure Agreement (NDA) MVPs are also given access to private newsgroups and a channel into Microsoft product groups.</p>
<p><span style="text-decoration:underline;"><span style="color:#800000;"><strong>FOR THOSE WHO DO NOT KNOW ME</strong></span></span></p>
<p>Hi,</p>
<p>I am <strong>SHARKER KHALEED MAHMUD</strong> and I am a <strong>SILVERLIGHT ADDICT</strong>. </p>
<p>Thanks<br />
Sharker Khaleed Mahmud<br />
DHAKA, BANGLADESH</p>
<p>SKYPEID: sharkerkhaleedmahmud<br />
MSN IQ: shamrat231@hotmail.com</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sharkerkhaleedmahmud.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sharkerkhaleedmahmud.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sharkerkhaleedmahmud.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sharkerkhaleedmahmud.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sharkerkhaleedmahmud.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sharkerkhaleedmahmud.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sharkerkhaleedmahmud.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sharkerkhaleedmahmud.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sharkerkhaleedmahmud.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sharkerkhaleedmahmud.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sharkerkhaleedmahmud.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sharkerkhaleedmahmud.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sharkerkhaleedmahmud.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sharkerkhaleedmahmud.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=209&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sharkerkhaleedmahmud.wordpress.com/2010/05/09/mvp-nomination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/207815c5b723f2943b1c12154ed3b929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shamrat231</media:title>
		</media:content>
	</item>
		<item>
		<title>Using ASP.NET Profile in Silverlight Part 1: Create Profile</title>
		<link>http://sharkerkhaleedmahmud.wordpress.com/2009/12/29/using-asp-net-profile-in-silverlight-part-1-create-profile/</link>
		<comments>http://sharkerkhaleedmahmud.wordpress.com/2009/12/29/using-asp-net-profile-in-silverlight-part-1-create-profile/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 07:34:14 +0000</pubDate>
		<dc:creator>Sharker Khaleed Mahmud &#124; shamrat231</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[asp.net profile in silverlight]]></category>
		<category><![CDATA[asp.net profile silverlight]]></category>
		<category><![CDATA[asp.net profile web project]]></category>
		<category><![CDATA[shamrat231]]></category>
		<category><![CDATA[Sharker Khaleed Mahmud]]></category>

		<guid isPermaLink="false">http://sharkerkhaleedmahmud.wordpress.com/?p=173</guid>
		<description><![CDATA[This week I will try to show you how easy it is to use ASP.NET profile in Silverlight. For this demonstration I will be using VS2010 Beta 2 and Silverlight.Net 4.0. The same technique is also applicable for people using VS2008 and Silverlight 3.0. So lets create a simple Silverlight project Now add couple things [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=173&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week I will try to show you how easy it is to use ASP.NET profile in Silverlight. For this demonstration I will be using VS2010 Beta 2 and Silverlight.Net 4.0. The same technique is also applicable for people using VS2008 and Silverlight 3.0.</p>
<p>So lets create a simple Silverlight project</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic1.png"><img class="alignnone size-full wp-image-174" title="a4pic1" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic1.png?w=480&#038;h=242" alt="" width="480" height="242" /></a></p>
<p>Now add couple things on the order shown.</p>
<ol>
<li>Add App_Code folder and then add a Profile.cs</li>
<li>Add App_Data folder and then add a Profle.mdf. On Data section in Add New Item form you will be able to add SQL Server Database.</li>
<li>Add a folder called WebServices. Then add Silverlight-enabled web service from Add New Item. This item is available at Silverlight section. Now name the service as ProfileService.svc</li>
</ol>
<p>The output should look something like this.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic2.png"><img class="alignnone size-full wp-image-175" title="a4pic2" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic2.png?w=265&#038;h=379" alt="" width="265" height="379" /></a> </p>
<p>Now add the newly created database in your SQL Server. In this case I am using SQL Server 2008. Use the attach property to add your database. The below illustration shows database configuration on my laptop. Do not expect the same settings on your pc. Use the attach option to attach the new database (Profile.mdf). Then click on the add button. Choose the database. Afterwards click on the ok button. It will attach the database and will create random name for the db. Rename to Profile. Confused? see below.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic3.png"><img class="alignnone size-full wp-image-177" title="a4pic3" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic3.png?w=675&#038;h=507" alt="" width="675" height="507" /></a></p>
<p>Now we add the <strong>ConnectionString</strong> to our web.Config for this database</p>
<p><span style="text-decoration:underline;"><strong>Web.Config</strong></span></p>
<p>&lt;connectionStrings&gt;<br />
    &lt;add name=&#8221;ConnectionString&#8221; connectionString=&#8221;Data Source=(local);Initial Catalog=Profile;Integrated Security=True&#8221;<br />
        providerName=&#8221;System.Data.SqlClient&#8221; /&gt;<br />
  &lt;/connectionStrings&gt;</p>
<p>Ok now we will use aspnet_regsql.exe to generate all the necessary tables related to Login system. You will find the exe file in for ASP.NET 4.0</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic4.png"><img class="alignnone size-full wp-image-180" title="a4pic4" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic4.png?w=510&#038;h=51" alt="" width="510" height="51" /></a></p>
<p>Run the exe depending on the version you are using. For this case I will be using v4.0. Give your server name and choose the profile database that you have created.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic6.png"><img class="alignnone size-full wp-image-181" title="a4pic6" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic6.png?w=358&#038;h=250" alt="" width="358" height="250" /></a></p>
<p>Click next and finish. If you now go to your database you will see all the necessary tables have been created. Now lets come back to VS2010. Open the profile class. I will now add property that i want to get or set in the database on the profile table. Here is an example on how that can be done. For eg. I will add a property call DashboardIndex where it will store some variables that the current user logged in. Rename the <strong>class name from profile </strong>to<strong> UserProfile</strong> and extend the class to <strong>ProfileBase</strong> as shown below.</p>
<p><span style="text-decoration:underline;"><strong>Profile.cs</strong></span></p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Profile;<br />
using System.Web.Security;</p>
<p>namespace Profile.Web<br />
{<br />
    public class UserProfile : ProfileBase<br />
    {<br />
        public string DashboardIndex<br />
        {<br />
            get { return base["DashboardIndex"] as string; }<br />
            set { base["DashboardIndex"] = value; }<br />
        }</p>
<p>        public static UserProfile GetUserProfile(string username)<br />
        {<br />
            return Create(username) as UserProfile;<br />
        }</p>
<p>        public static UserProfile GetUserProfile()<br />
        {<br />
            MembershipUser user = Membership.GetUser();<br />
            if (user != null)<br />
            {<br />
                return Create(user.UserName) as UserProfile;<br />
            }<br />
            else<br />
            {<br />
                return null;<br />
            }<br />
        }<br />
    }<br />
}</p>
<p>The first method creates a user profile against the asp.net login username that you assign. The second method creates an asp.net profile based on the current logged in user. Lets for now keep the profile class as simple as possible. Go to your current Web.config to add the profile tag as shown below.</p>
<p><span style="text-decoration:underline;"><strong>Web.Config</strong></span></p>
<p>&lt;system.web&gt;<br />
    &lt;compilation debug=&#8221;true&#8221; targetFramework=&#8221;4.0&#8243; /&gt;<br />
    &lt;profile enabled=&#8221;true&#8221; defaultProvider=&#8221;CustomProfileProvider&#8221; inherits=&#8221;<strong>Profile.Web</strong>.<strong>UserProfile</strong>&#8221; automaticSaveEnabled=&#8221;true&#8221;&gt;<br />
      &lt;providers&gt;<br />
        &lt;clear/&gt;<br />
        &lt;add name=&#8221;CustomProfileProvider&#8221; type=&#8221;System.Web.Profile.SqlProfileProvider&#8221; connectionStringName=&#8221;ConnectionString&#8221; applicationName=&#8221;/&#8221; /&gt;<br />
      &lt;/providers&gt;<br />
    &lt;/profile&gt;<br />
&lt;/system.web&gt;</p>
<p>Look at the bold code part. Here <strong>Profile.Web </strong>is the namespace in Profile.cs (have class UserProfile).</p>
<p>Thats all about setting up profiling. Now to access asp.net profile information, I will create two methods on my Profile.svc. One method is to get the value from the database on DasboardIndex property. Another method will be used to save the dashboard index value given by the user. See the code below.</p>
<p><span style="text-decoration:underline;"><strong> ProfileService.svc</strong></span></p>
<p>using System;<br />
using System.Linq;<br />
using System.Runtime.Serialization;<br />
using System.ServiceModel;<br />
using System.ServiceModel.Activation;</p>
<p>namespace Profile.Web<br />
{<br />
    [ServiceContract(Namespace = "")]<br />
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]<br />
    public class ProfileService<br />
    {<br />
        [OperationContract]<br />
        public string GetCurrentDashboardSettings()<br />
        {<br />
            UserProfile profile = UserProfile.GetUserProfile();<br />
            return profile.DashboardIndex;<br />
        }</p>
<p>        [OperationContract]<br />
        public void SaveCurrentDashboardSettings(string indexCollection)<br />
        {<br />
            UserProfile profile = UserProfile.GetUserProfile();<br />
            profile.DashboardIndex = indexCollection;<br />
            profile.Save();<br />
        }<br />
    }<br />
}</p>
<p>Now go to web.config and remove the bindingConfiguration=&#8221;Profile.Web.ProfileService.customBinding0&#8243; and change the binding to binding=&#8221;<strong>basicHttpBinding</strong>&#8221; as shown below</p>
<p><span style="text-decoration:underline;"><strong>Web.Config</strong></span></p>
<p>         &lt;services&gt;<br />
            &lt;service name=&#8221;Profile.Web.ProfileService&#8221;&gt;<br />
                &lt;endpoint address=&#8221;" binding=&#8221;basicHttpBinding&#8221;<br />
                    contract=&#8221;Profile.Web.ProfileService&#8221; /&gt;<br />
                &lt;endpoint address=&#8221;mex&#8221; binding=&#8221;mexHttpBinding&#8221; contract=&#8221;IMetadataExchange&#8221; /&gt;<br />
            &lt;/service&gt;<br />
        &lt;/services&gt;</p>
<p>Ok now go to Profile Silverlight project. Right click on the project and choose the Add Service Reference option. A form will open. Click on the Discover button.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic7.png"><img class="alignnone size-full wp-image-184" title="a4pic7" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic7.png?w=542&#038;h=455" alt="" width="542" height="455" /></a></p>
<p>On clicking the ok button a ProfileServiceReference will be created. Guess I will finish here. Any comments welcome. On next post i will continue with part 2.</p>
<p>Thanks<br />
Sharker Khaleed Mahmud<br />
MCTS, MCPD<br />
DHAKA, BANGLADESH</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sharkerkhaleedmahmud.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sharkerkhaleedmahmud.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sharkerkhaleedmahmud.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sharkerkhaleedmahmud.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sharkerkhaleedmahmud.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sharkerkhaleedmahmud.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sharkerkhaleedmahmud.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sharkerkhaleedmahmud.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sharkerkhaleedmahmud.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sharkerkhaleedmahmud.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sharkerkhaleedmahmud.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sharkerkhaleedmahmud.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sharkerkhaleedmahmud.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sharkerkhaleedmahmud.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=173&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sharkerkhaleedmahmud.wordpress.com/2009/12/29/using-asp-net-profile-in-silverlight-part-1-create-profile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/207815c5b723f2943b1c12154ed3b929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shamrat231</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic1.png" medium="image">
			<media:title type="html">a4pic1</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic2.png" medium="image">
			<media:title type="html">a4pic2</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic3.png" medium="image">
			<media:title type="html">a4pic3</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic4.png" medium="image">
			<media:title type="html">a4pic4</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic6.png" medium="image">
			<media:title type="html">a4pic6</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/12/a4pic7.png" medium="image">
			<media:title type="html">a4pic7</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight Prism Part 2 : Model View View Model (MVVM) Concept</title>
		<link>http://sharkerkhaleedmahmud.wordpress.com/2009/11/25/silverlight-prism-part-2-model-view-view-model-mvvm-concept/</link>
		<comments>http://sharkerkhaleedmahmud.wordpress.com/2009/11/25/silverlight-prism-part-2-model-view-view-model-mvvm-concept/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 04:15:45 +0000</pubDate>
		<dc:creator>Sharker Khaleed Mahmud &#124; shamrat231</dc:creator>
				<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[MVVM Digg]]></category>
		<category><![CDATA[Prism Digg]]></category>
		<category><![CDATA[shamrat231]]></category>
		<category><![CDATA[Sharker Khaleed Mahmud]]></category>

		<guid isPermaLink="false">http://sharkerkhaleedmahmud.wordpress.com/?p=144</guid>
		<description><![CDATA[Before we start with the part 2, I would like to introduce you to the concept of ModelView-View-Model (MVVM). We will be integrating MVVM in this part by giving simple example. MVVM MVVM is a great pattern to start with. MVVM allows the user to separate the View from the data and logic layer. So [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=144&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic2.png"></a>Before we start with the part 2, I would like to introduce you to the concept of ModelView-View-Model (MVVM). We will be integrating MVVM in this part by giving simple example.</p>
<p><span style="text-decoration:underline;">MVVM</span></p>
<p>MVVM is a great pattern to start with. MVVM allows the user to separate the View from the data and logic layer. So basically the designer can work on the xaml part on the blend while the developer can work on the data and logic on a separate view model class. In other words, separation of presentation layer and data access layer is being done very easily.</p>
<p><span style="text-decoration:underline;">VIEWS</span></p>
<p>A view can be a simple xaml usercontrol. Usually, you put it in a Views folder. You can put resources, animation, navigation, powerful bindings and themes in the usercontrol. I would suggest that you put the resource in different places like in App.xaml but it is easier for the designer to work on the xaml control in blend if the resources are there. You will be leaving the data logic of binding in your view model class and not in your Views usercontrol (.cs) and thus loose coupling allows greater reusability and easier Dependency Injection(DI) and maintainability .</p>
<p>This is a continuation of <a title="Silverlight Prism Part 1 : Get Started" href="http://sharkerkhaleedmahmud.wordpress.com/2009/11/15/getting-started-with-silverlight-prism-part-1/">Silverlight Prism Part 1 : Get Started</a> of Silverlight Prism. So lets change some of the name and create some directories as shown below to introduce MVVM. For simplicity, we will create directory for each part of Model View ViewModel.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic1.png"><img class="alignnone size-full wp-image-147" title="a3pic1" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic1.png?w=248&#038;h=312" alt="" width="248" height="312" /></a></p>
<p>So first lets look at the model class where i will be creating properties for our stories. I will be using <a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-3-using-networking-to-retrieve-data-and-populate-a-datagrid.aspx" target="_blank">Scott Digg</a> example here.</p>
<p><span style="text-decoration:underline;">StoriesMdel.cs</span></p>
<p>    public class StoriesModel<br />
    {<br />
        public int Id { get; set; }<br />
        public string Title { get; set; }<br />
        public string Description { get; set; }<br />
        public int NumDiggs { get; set; }<br />
        public Uri HrefLink { get; set; }<br />
        public string ThumbNail { get; set; }<br />
    }</p>
<p>So basically that is an example of model i.e stories. I will now use this model in our view model class by creating dummy collection and modifing the views to show some actual output. For this we will copy the code from Digg  example and put it in our view. I will also be using the same design (App.xaml) that Scott created. At the moment, I am reusing only six Scott styles in the (SearchModuleResultViewModel.xaml) view.</p>
<p>The styles that I have used here are </p>
<ol>
<li>DiggPanel</li>
<li>StoriesList</li>
<li>NumDiggs</li>
<li>NumDigsSubBlock</li>
<li>ThumbNailPreview</li>
<li>TitleBlock</li>
</ol>
<p><span style="text-decoration:underline;">SearchModuleResultView.xaml</span> (View)</p>
<p>&lt;UserControl x:Class=&#8221;SimplePrismApplication.Search.SearchModuleResultView&#8221;<br />
    xmlns=&#8221;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&#8220;<br />
    xmlns:x=&#8221;<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>&#8220;<br />
    xmlns:d=&#8221;<a href="http://schemas.microsoft.com/expression/blend/2008">http://schemas.microsoft.com/expression/blend/2008</a>&#8220;<br />
    xmlns:mc=&#8221;<a href="http://schemas.openxmlformats.org/markup-compatibility/2006">http://schemas.openxmlformats.org/markup-compatibility/2006</a>&#8220;<br />
    mc:Ignorable=&#8221;d&#8221;<br />
    d:DesignHeight=&#8221;300&#8243; d:DesignWidth=&#8221;400&#8243;&gt;<br />
    &lt;Grid x:Name=&#8221;LayoutRoot&#8221; Background=&#8221;Beige&#8221; Height=&#8221;300&#8243;&gt;<br />
        &lt;ListBox x:Name=&#8221;StoriesList&#8221; Style=&#8221;{StaticResource StoriesList}&#8221; ItemsSource=&#8221;{Binding Stories}&#8221;&gt;<br />
            &lt;ListBox.ItemTemplate&gt;<br />
                &lt;DataTemplate&gt;<br />
                    &lt;StackPanel Orientation=&#8221;Horizontal&#8221;&gt;<br />
                        &lt;!&#8211; Yellow Digg Panel with NumDiggs&#8211;&gt;<br />
                        &lt;StackPanel Style=&#8221;{StaticResource DiggPanel}&#8221; &gt;<br />
                            &lt;TextBlock Text=&#8221;{Binding NumDiggs}&#8221; Style=&#8221;{StaticResource NumDigsBlock}&#8221; /&gt;<br />
                            &lt;TextBlock Text=&#8221;diggs&#8221; Style=&#8221;{StaticResource NumDigsSubBlock}&#8221; /&gt;<br />
                        &lt;/StackPanel&gt;<br />
                        &lt;!&#8211; Story Thumbnail Preview &#8211;&gt;<br />
                        &lt;Image Source=&#8221;{Binding ThumbNail}&#8221; Style=&#8221;{StaticResource ThumbNailPreview}&#8221; /&gt;<br />
                        &lt;!&#8211; Story Title&#8211;&gt;<br />
                        &lt;TextBlock Text=&#8221;{Binding Title}&#8221; Margin=&#8221;5&#8243; Style=&#8221;{StaticResource TitleBlock}&#8221;/&gt;<br />
                    &lt;/StackPanel&gt;<br />
                &lt;/DataTemplate&gt;<br />
            &lt;/ListBox.ItemTemplate&gt;<br />
        &lt;/ListBox&gt;<br />
    &lt;/Grid&gt;<br />
&lt;/UserControl&gt;</p>
<p>Put the styles in App.xaml file for now. Now, all left is to create some dummy variables and see the output. At code level, we will create constructor injection by injecting our view model in the constructor of the view like this.</p>
<p><span style="text-decoration:underline;">SearchModuleResultView.xaml.cs</span></p>
<p>    public partial class SearchModuleResultView : UserControl<br />
    {<br />
        public SearchModuleResultView(SearchModuleResultViewModel viewModel)<br />
        {<br />
            InitializeComponent();<br />
            this.DataContext = viewModel;<br />
        }<br />
    }</p>
<p>We have set the <strong>DataContext</strong> to the view model, thus taking care of binding. So lets create some dummy variables and see if this works or not.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic2.png"><img class="alignnone size-full wp-image-153" title="a3pic2" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic2.png?w=290&#038;h=170" alt="" width="290" height="170" /></a></p>
<p><span style="text-decoration:underline;">SearchModuleResultViewModel.cs</span></p>
<p>    public class SearchModuleResultViewModel<br />
    {<br />
        public List&lt;StoriesModel&gt; Stories { get; set; }</p>
<p>        public SearchModuleResultViewModel()<br />
        {<br />
            Stories = Stories ?? new List&lt;StoriesModel&gt;();</p>
<p>            Stories.Add(new StoriesModel { Title=&#8221;example 1&#8243;, Description= &#8220;fdfd&#8221;, NumDiggs=2 });<br />
        }<br />
    }</p>
<p><strong><span style="text-decoration:underline;">Static content output.</span></strong></p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic31.png"><img class="alignnone size-full wp-image-156" title="a3pic3" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic31.png?w=189&#038;h=89" alt="" width="189" height="89" /></a><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic3.png"></a></p>
<p>Hmm, so far we have tested the MVVM concept and implemented digg sample using static content. Now we will test it using live web service.  Before we create webservice, we need to create an interface. So lets add a new folder call WebService and add a new interface class called ISimpleService.cs. In here we add a method search to do search with a callback mechanism.</p>
<p><span style="text-decoration:underline;">ISimpleService.cs</span></p>
<p>using System.Collections.Generic;</p>
<p>namespace SimplePrismApplication.Search<br />
{<br />
    public interface ISimpleService<br />
    {<br />
        void DiggSearch(string value, Action&lt;IEnumerable&lt;StoriesModel&gt;&gt; SearchCallBack);<br />
    }<br />
}</p>
<p>Now we need to add reference of this interface to the view model class.</p>
<p><span style="text-decoration:underline;">SearchModuleResultViewModel.cs</span></p>
<p>    public class SearchModuleResultViewModel<br />
    {<br />
        public List&lt;StoriesModel&gt; Stories { get; set; }<br />
        public ISimpleService DiggService { get; set; }</p>
<p>        public SearchModuleResultViewModel(ISimpleService service)<br />
        {<br />
            Stories = Stories ?? new List&lt;StoriesModel&gt;();<br />
            this.DiggService = service;<br />
            this.DiggService.DiggSearch(&#8220;baseball&#8221;, OnSearchCompleted);<br />
        }</p>
<p>        private void OnSearchCompleted(IEnumerable&lt;StoriesModel&gt; StoriesModel)<br />
        {<br />
            this.Stories.Clear();<br />
            foreach(StoriesModel story in StoriesModel)<br />
            {<br />
                this.Stories.Add(story);<br />
            }<br />
        }<br />
    }</p>
<p>We will add a webservice called Service.cs in WebService folder inheriting the interface ISimpleService.cs. Also add a reference of System.Xml.Linq to your Silverlight project. Reusing the code from Scott blog, it looks like this.</p>
<p><span style="text-decoration:underline;">DiggService.cs</span></p>
<p>using System.Xml.Linq;<br />
using System.Linq;</p>
<p>namespace SimplePrismApplication.Search<br />
{<br />
    public class DiggService : ISimpleService<br />
    {<br />
        public void DiggSearch(string value, Action&lt;IEnumerable&lt;StoriesModel&gt;&gt; SearchCallBack)<br />
        {<br />
            // url<br />
            string url = String.Format(&#8220;<a href="http://services.digg.com/stories/topic/{0}?count=20&amp;appkey=http%3A%2F%2Fscottgu.com">http://services.digg.com/stories/topic/{0}?count=20&amp;appkey=http%3A%2F%2Fscottgu.com</a>&#8220;, value);</p>
<p>            // Initiate Async Network call to Digg<br />
            WebClient service = new WebClient();<br />
            service.DownloadStringCompleted += (sender, e) =&gt; SearchCallBack(DisplayStories(e));<br />
            service.DownloadStringAsync(new Uri(url));<br />
        }</p>
<p>        private IEnumerable&lt;StoriesModel&gt; DisplayStories(DownloadStringCompletedEventArgs e)<br />
        {<br />
            XDocument xmlStories = XDocument.Parse(e.Result);</p>
<p>            var stories = from story in xmlStories.Descendants(&#8220;story&#8221;)<br />
                          where story.Element(&#8220;thumbnail&#8221;) != null &amp;&amp;<br />
                                !story.Element(&#8220;thumbnail&#8221;).Attribute(&#8220;src&#8221;).Value.EndsWith(&#8220;.gif&#8221;)<br />
                          select new StoriesModel<br />
                          {<br />
                              Id = (int)story.Attribute(&#8220;id&#8221;),<br />
                              Title = ((string)story.Element(&#8220;title&#8221;)).Trim(),<br />
                              Description = ((string)story.Element(&#8220;description&#8221;)).Trim(),<br />
                              ThumbNail = (string)story.Element(&#8220;thumbnail&#8221;).Attribute(&#8220;src&#8221;).Value,<br />
                              HrefLink = new Uri((string)story.Attribute(&#8220;link&#8221;)),<br />
                              NumDiggs = (int)story.Attribute(&#8220;diggs&#8221;),<br />
                          };</p>
<p>            return stories;<br />
        }<br />
    }<br />
}</p>
<p>Now hitting F5 will not display the output as in this case we are using web service, not static content. So we need to register the webservice in the UnityContainer. We do that in our module section.</p>
<p>in the SearchModule constructor we set</p>
<p>        public SearchModule(IRegionManager regionManager, IUnityContainer container)<br />
        {<br />
            this.regionManager = regionManager;<br />
            this.container = container;<br />
        }</p>
<p>and register the service in the IUnityContainer like this</p>
<p>        public void Initialize()<br />
        {<br />
            this.container.RegisterType&lt;ISimpleService, DiggService&gt;(new ContainerControlledLifetimeManager());<br />
            this.regionManager.RegisterViewWithRegion(&#8220;ResultRegion&#8221;, typeof(SearchModuleResultView));<br />
        }</p>
<p>Hit F5 and see the output. Funny thing it will not show the deserved output. Why? The binding is being done before we receive the data from the webservice. Well that is the scenario at the moment. Now to avoid that i will use <strong>ObservableCollection</strong> instead of <strong>List</strong> like this</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic4.png"><img class="alignnone size-full wp-image-160" title="a3pic4" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic4.png?w=485&#038;h=173" alt="" width="485" height="173" /></a></p>
<p><span style="text-decoration:underline;">Output</span></p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic5.png"><img class="alignnone size-full wp-image-161" title="a3pic5" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic5.png?w=801&#038;h=302" alt="" width="801" height="302" /></a></p>
<p>Thanks<br />
Sharker Khaleed Mahmud<br />
Software Developer<br />
(MCP,MCTS,MCPD[web])</p>
<p>References:</p>
<p><a href="http://johnpapa.net/silverlight/5-minute-overview-of-mvvm-in-silverlight/" target="_blank">5 Minute Overview of MVVM in Silverlight : JohnPapa.net</a><br />
<a href="http://www.codeplex.com/CompositeWPF/" target="_blank">Codeplex Sample</a><br />
<a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-3-using-networking-to-retrieve-data-and-populate-a-datagrid.aspx" target="_blank">Scott DiggExample</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sharkerkhaleedmahmud.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sharkerkhaleedmahmud.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sharkerkhaleedmahmud.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sharkerkhaleedmahmud.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sharkerkhaleedmahmud.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sharkerkhaleedmahmud.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sharkerkhaleedmahmud.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sharkerkhaleedmahmud.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sharkerkhaleedmahmud.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sharkerkhaleedmahmud.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sharkerkhaleedmahmud.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sharkerkhaleedmahmud.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sharkerkhaleedmahmud.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sharkerkhaleedmahmud.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=144&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sharkerkhaleedmahmud.wordpress.com/2009/11/25/silverlight-prism-part-2-model-view-view-model-mvvm-concept/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/207815c5b723f2943b1c12154ed3b929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shamrat231</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic1.png" medium="image">
			<media:title type="html">a3pic1</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic2.png" medium="image">
			<media:title type="html">a3pic2</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic31.png" medium="image">
			<media:title type="html">a3pic3</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic4.png" medium="image">
			<media:title type="html">a3pic4</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a3pic5.png" medium="image">
			<media:title type="html">a3pic5</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight Prism Part 1 : Get Started</title>
		<link>http://sharkerkhaleedmahmud.wordpress.com/2009/11/15/getting-started-with-silverlight-prism-part-1/</link>
		<comments>http://sharkerkhaleedmahmud.wordpress.com/2009/11/15/getting-started-with-silverlight-prism-part-1/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 10:26:47 +0000</pubDate>
		<dc:creator>Sharker Khaleed Mahmud &#124; shamrat231</dc:creator>
				<category><![CDATA[Prism]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Prism tutorial]]></category>
		<category><![CDATA[shamrat231]]></category>
		<category><![CDATA[Sharker Khaleed Mahmud]]></category>
		<category><![CDATA[Silverlight Prism]]></category>
		<category><![CDATA[silverlight prism tutorial]]></category>

		<guid isPermaLink="false">http://sharkerkhaleedmahmud.wordpress.com/?p=96</guid>
		<description><![CDATA[Before starting with this tutorial, you should download the latest Prism. Prism 2.1 has been released to support Silverlight 3. You can download Prism 2.1 here This will be for now two part series. 1. Silverlight Prism Part 1 : Get Started 2. Silverlight Prism Part 2 : Model View View Model (MVVM) Concept So first [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=96&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Before starting with this tutorial, you should download the latest Prism. <strong>Prism 2.1</strong> has been released to support Silverlight 3. You can download Prism 2.1 <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=387c7a59-b217-4318-ad1b-cbc2ea453f40" target="_blank">here</a></p>
<p>This will be for now two part series.</p>
<p>1. <a title="Permanent Link to Url Routing in ASP.NET the simplest way" href="http://sharkerkhaleedmahmud.wordpress.com/2009/11/15/getting-started-with-silverlight-prism-part-1/">Silverlight Prism Part 1 : Get Started</a><br />
2. <a title="Permanent Link to Silverlight Prism Part 2 : Model View View Model (MVVM) Concept" rel="bookmark" href="http://sharkerkhaleedmahmud.wordpress.com/2009/11/25/silverlight-prism-part-2-model-view-view-model-mvvm-concept/">Silverlight Prism Part 2 : Model View View Model (MVVM) Concept</a></p>
<p>So first of all lets create a simple web project in Silverlight 3. Add a Silverlight usercontrol page named as <strong>Shell.xaml</strong>. Think of shell as the top level where the view will be shown. Delete the built in mainpage.xaml. Ok now to use prism, you need to connect the project to prism or add reference of the prism dll. To do that goto add reference and add the prism libraries. </p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic21.png"><img title="a2pic2" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic21.png?w=409&#038;h=267&#038;h=267" alt="a2pic2" width="409" height="267" /></a> </p>
<p>Open the folder, where u have unpack the exe file. Run the bat file with name [Desktop &amp; Silverlight - Open Composite Application Library.bat]. Compile the project . According to the readme file, the Composite Application Library assemblies for a Silverlight application will be placed in the CAL\Silverlight\ (look in all debug folder)</p>
<p>Put all the dll file in a folder(eg. Prism). There will be total 7 dll files. </p>
<ol>
<li>Microsoft.Practices.Composite.dll</li>
<li>Microsoft.Practices.Composite.Presentation.dll</li>
<li>Microsoft.Practices.Composite.UnityExtensions.dll</li>
<li>Microsoft.Practices.ServiceLocation.dll</li>
<li>Microsoft.Practices.Unity.dll</li>
<li>Microsoft.Silverlight.Testing.dll</li>
<li>Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</li>
</ol>
<p>Ok, now before we add a simple class called BootStrapper.cs, lets talk more about the Shell. Shell.xaml is more like your ASP.NET Masterpage. In here, we define the placeholders as regions. We can show a view on the shell by assigning a view to a particular region. You can design your shell page and apply styles as u like. So basically u will have a single shell page where u can apply mutiple designs according to the styles you create to give different outlook.</p>
<p>Ok we will now add code to BootStrapper.cs</p>
<p> <code><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic3.png"><img title="a2pic3" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic3.png?w=577&#038;h=335&#038;h=335" alt="a2pic3" width="577" height="335" /></a></code>  </p>
<p><span style="text-decoration:underline;">BootStrapper.cs</span></p>
<p>    public class BootStrapper : UnityBootstrapper<br />
    {<br />
        protected override DependencyObject CreateShell()<br />
        {<br />
            Shell main = new Shell();<br />
            Application.Current.RootVisual = main;<br />
            return main;<br />
        }</p>
<p>        protected override Microsoft.Practices.Composite.Modularity.IModuleCatalog GetModuleCatalog()<br />
        {<br />
            ModuleCatalog modules = new ModuleCatalog();<br />
            // in here we add modules <br />
           return modules;<br />
        }<br />
    }</p>
<p>At code level, inherit the UnityBootstrapper from using Microsoft.Practices.Composite.UnityExtensions; In has a abstract class called CreateShell(). In this method we will return the Shell user control we have created . Now we have to connect the Bootstrapper to our application. For that, lets go to app.xaml and remove the line from Application_Startup and add the new line</p>
<p><span style="text-decoration:underline;">App.xaml</span></p>
<p>        private void Application_Startup(object sender, StartupEventArgs e)<br />
        {<br />
            new BootStrapper().Run();<br />
        }</p>
<p>Ok, lets talk about bootstrapper class.  Here we are assign the RootVisual of the SL application and register modules. We have finished with our shell part, so lets create a module. We add now a second project and name it SimplePrismApplication.Search. Same as before, we add the Prism dll to this project. Now create the files listed below</p>
<ol>
<li>SearchModuleResultView.xaml in Views [folder]</li>
<li>SearchModule.cs</li>
<li>SearchResult.cs</li>
<li>and SearchModuleResultViewModel.cs</li>
</ol>
<p>The output should be as shown below  </p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic4.png"><img title="a2pic4" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic4.png?w=237&#038;h=127&#038;h=127" alt="a2pic4" width="237" height="127" /></a> </p>
<p><strong>What do we mean by Module?</strong></p>
<p>Module can be views, collection of related components, such as features, views, or business logic.  GetModuleCatalog() in our BootStrapper.cs we are adding the modules that our application will be using. So lets define a module.</p>
<p><span style="text-decoration:underline;">SearchModule.cs </span></p>
<p>using Microsoft.Practices.Composite.Modularity;<br />
using Microsoft.Practices.Composite.Regions;<br />
using Microsoft.Practices.Unity;</p>
<p> namespace SimplePrismApplication.Search<br />
{<br />
    public class SearchModule : IModule<br />
    {<br />
        #region IModule Members</p>
<p>        private IRegionManager regionManager;<br />
        IUnityContainer container;</p>
<p>        public SearchModule(IRegionManager regionManager, IUnityContainer container)<br />
        {<br />
            this.regionManager = regionManager;<br />
        }</p>
<p>        public void Initialize()<br />
        {<br />
            this.regionManager.RegisterViewWithRegion(“ResultRegion”, typeof(SearchModuleResultView));<br />
        }</p>
<p>         #endregion<br />
    }<br />
}</p>
<p>Our module class is inheriting the IModule interface. Here we are registering a view in the region manager. We are assigning our SearchModuleResultView view with a particular region name “ResultRegion” in our Shell.xaml. In our Shell.xaml we add a region as shown below.</p>
<p><span style="text-decoration:underline;">Shell.xaml</span></p>
<p> &lt;UserControl x:Class=&#8221;SimplePrismApplication.Shell&#8221;<br />
    xmlns=&#8221;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&#8220;<br />
    xmlns:x=&#8221;<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>&#8220;<br />
    xmlns:d=&#8221;<a href="http://schemas.microsoft.com/expression/blend/2008">http://schemas.microsoft.com/expression/blend/2008</a>&#8220;<br />
    xmlns:mc=&#8221;<a href="http://schemas.openxmlformats.org/markup-compatibility/2006">http://schemas.openxmlformats.org/markup-compatibility/2006</a>&#8220;<br />
    mc:Ignorable=&#8221;d&#8221;<br />
   <strong> xmlns:Desings=&#8221;clr-namespace:Microsoft.Practices.Composite.Presentation.Regions;assembly=Microsoft.Practices.Composite.Presentation&#8221;<br />
</strong>    &gt;<br />
    &lt;Grid x:Name=&#8221;LayoutRoot&#8221; Background=&#8221;Silver&#8221;&gt;<br />
        &lt;StackPanel&gt;<br />
            &lt;ItemsControl Desings:RegionManager.RegionName=&#8221;ResultRegion&#8221; Width=&#8221;800&#8243; Height=&#8221;600&#8243; &gt;&lt;/ItemsControl&gt;<br />
        &lt;/StackPanel&gt;<br />
    &lt;/Grid&gt;<br />
&lt;/UserControl&gt;</p>
<p>Look at the bold part, you have to add the region namespace to define a particular region. We will show our current view to this itemcontrol having the region name &#8220;ResultRegion&#8221;. So lets add some text in our view and run the project.</p>
<p><span style="text-decoration:underline;">SearchModuleResultView.xaml</span></p>
<p>&lt;UserControl x:Class=&#8221;SimplePrismApplication.Search.SearchModuleResultView&#8221;<br />
    xmlns=&#8221;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&#8220;<br />
    xmlns:x=&#8221;<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>&#8220;<br />
    xmlns:d=&#8221;<a href="http://schemas.microsoft.com/expression/blend/2008">http://schemas.microsoft.com/expression/blend/2008</a>&#8220;<br />
    xmlns:mc=&#8221;<a href="http://schemas.openxmlformats.org/markup-compatibility/2006">http://schemas.openxmlformats.org/markup-compatibility/2006</a>&#8220;<br />
    mc:Ignorable=&#8221;d&#8221;<br />
    d:DesignHeight=&#8221;300&#8243; d:DesignWidth=&#8221;400&#8243;&gt;<br />
    &lt;Grid x:Name=&#8221;LayoutRoot&#8221; Background=&#8221;Beige&#8221;&gt;<br />
        &lt;TextBlock Text=&#8221;end of part 1, will continue in part 2&#8243; /&gt;<br />
    &lt;/Grid&gt;<br />
&lt;/UserControl&gt;</p>
<p>For the view to show in the given region, first you have to add the reference SimplePrismApplication.Search in your SimplePrismApplication. Then on the bootstrapper.cs add the module in our GetModuleCatalog()</p>
<p>            ModuleCatalog modules = new ModuleCatalog();<br />
            modules.AddModule(typeof(SearchModule)); //using SimplePrismApplication.Search;<br />
            return modules;</p>
<p>Hit F5 and see the output.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic51.png"></a><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic51.png"><img class="alignnone size-full wp-image-129" title="a2pic5" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic51.png?w=507&#038;h=148" alt="a2pic5" width="507" height="148" /></a><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic5.png"></a></p>
<p>Guess I will finish here. Any comments welcome. Next week I will continue with part 2.</p>
<p>Thanks<br />
Sharker Khaleed Mahmud<br />
MCTS, MCPD<br />
DHAKA, BANGLADESH</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sharkerkhaleedmahmud.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sharkerkhaleedmahmud.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sharkerkhaleedmahmud.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sharkerkhaleedmahmud.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sharkerkhaleedmahmud.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sharkerkhaleedmahmud.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sharkerkhaleedmahmud.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sharkerkhaleedmahmud.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sharkerkhaleedmahmud.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sharkerkhaleedmahmud.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sharkerkhaleedmahmud.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sharkerkhaleedmahmud.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sharkerkhaleedmahmud.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sharkerkhaleedmahmud.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=96&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sharkerkhaleedmahmud.wordpress.com/2009/11/15/getting-started-with-silverlight-prism-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/207815c5b723f2943b1c12154ed3b929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shamrat231</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic21.png?w=409&#038;h=267&#038;h=267" medium="image">
			<media:title type="html">a2pic2</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic3.png?w=577&#038;h=335&#038;h=335" medium="image">
			<media:title type="html">a2pic3</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic4.png?w=237&#038;h=127&#038;h=127" medium="image">
			<media:title type="html">a2pic4</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/a2pic51.png" medium="image">
			<media:title type="html">a2pic5</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET Url Routing tutorial in simple ways</title>
		<link>http://sharkerkhaleedmahmud.wordpress.com/2009/11/04/url-routing-in-asp-net-the-simplest-way/</link>
		<comments>http://sharkerkhaleedmahmud.wordpress.com/2009/11/04/url-routing-in-asp-net-the-simplest-way/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 14:19:51 +0000</pubDate>
		<dc:creator>Sharker Khaleed Mahmud &#124; shamrat231</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET routing]]></category>
		<category><![CDATA[shamrat231]]></category>
		<category><![CDATA[Sharker Khaleed Mahmud]]></category>
		<category><![CDATA[url routing asp.net]]></category>

		<guid isPermaLink="false">http://sharkerkhaleedmahmud.wordpress.com/?p=9</guid>
		<description><![CDATA[The main purpose of this article is to show you how easy it is to implement url routing. I will not be using any database or complex scenario to explain the concept as this is my first article. Things that will cover in this article are given below. • Managed Code url routing • Hard-Coded [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=9&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The main purpose of this article is to show you how easy it is to implement url routing. I will not be using any database or complex scenario to explain the concept as this is my first article. Things that will cover in this article are given below.</p>
<p>• Managed Code url routing<br />
• Hard-Coded url routing<br />
• Markup url routing<br />
• Unnamed url routing<br />
• Catching routing parameters</p>
<p>First of all lets create a simple project in ASP.NET.<br />
<a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic15.png"><img class="alignnone size-medium wp-image-51" title="pic15" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic15.png?w=300&#038;h=258" border="0" alt="pic15" width="300" height="258" /></a></p>
<p>Once you click on ok, a sample asp.net project will be created. Now lets add 5 web form pages(.aspx) in a folder name UrlDemo. Each page is using the builtin master page (Site.Master). Afterwards, create a class UrlRoute.cs in a new folder. Give the folder name App_Code.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic2.png"><img src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic2.png?w=203&#038;h=427" alt="pic2" title="pic2" width="203" height="427" class="alignnone size-full wp-image-37" /></a></p>
<p>Now add a simple static method in UrlRoute.cs using the System.Web.Routing class</p>
<p><code>public static void RegisterRoutes(RouteCollection routes)<br />
{<br />
}</code></p>
<p>RouteCollection just provides a collection of route for ASP.NET routing. So lets add some routes to this collection.</p>
<p>MapPageRoute is a helper method. In the first parameter you give a name of the route. For simplicity, lets assing name like AboutRoute, SearchRoute etc. The second parameter is the parameter that will be shown on the browser url. You can also pass parameter if needed. The over loading method for MapPageRoute also allows you to add constraint and default parameter. See the below example.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic3.png"><img class="alignnone size-full wp-image-38" title="pic3" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic3.png?w=539&#038;h=141" alt="pic3" width="539" height="141" /></a></p>
<p>Here we have created two routes. The first one has name “MainRoute”. The second parameter is the pattern that will be shown to the user. It may contain multiple place holder(s) if needed. I will talk about it a bit later. The last parameter contains the physical location of the file that we are routing.</p>
<p>Ok, now we will call this RegisterRoutes method from Application_Start</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic4.png"><img class="alignnone size-full wp-image-39" title="pic4" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic4.png?w=355&#038;h=78" alt="pic4" width="355" height="78" /></a><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic3.png"></a></p>
<p>Great we are almost there. Now I am going to show you how we can use this routing from code level. First, open default.aspx web form that is provided by default. Add some hyperlink(s)</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic5.png"><img class="alignnone size-full wp-image-40" title="pic5" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic5.png?w=624&#038;h=120" border="0" alt="pic5" width="624" height="120" /></a></p>
<p>Now on default.aspx.cs, i will create a sample virtual path (VirtualPathData) for MainRoute.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic6.png"><img class="alignnone size-full wp-image-41" title="pic6" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic6.png?w=452&#038;h=330" border="0" alt="pic6" width="452" height="330" /></a></p>
<p>Hit F5 and put a debug on the last line. At runtime, you will be able to see the url pattern at debuging virtual path as shown below. So we can conclude uptil now its working.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic7.png"><img class="alignnone size-full wp-image-42" title="pic7" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic7.png?w=450&#038;h=39" border="0" alt="pic7" width="450" height="39" /></a></p>
<p>So far we have created a sample virtual path from code level. The next route is AboutRoute. In this one i will show you on how can we assign path directly. Look at the picture below. Remember, we have already added the route path in RegisterRoutes method.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic8.png"><img class="alignnone size-full wp-image-43" title="pic8" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic8.png?w=440&#038;h=53" border="0" alt="pic8" width="440" height="53" /></a></p>
<p>By the way, try adding information  in all of the pages like the way given below. So you will know that the routing is actually working.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic9.png"><img class="alignnone size-full wp-image-44" title="pic9" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic9.png?w=324&#038;h=194" border="0" alt="pic9" width="324" height="194" /></a></p>
<p>Ok, so we have cover the basics. Now I will register more routes by adding new routes.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic10.png"><img class="alignnone size-full wp-image-45" title="pic10" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic10.png?w=509&#038;h=362" border="0" alt="pic10" width="509" height="362" /></a></p>
<p>Here, we have created a CustomerRoute with a second parameter containing the pattern. In this case, it’s a simple pattern with a {year} place holder and  to-catch other {*paramerters} here. In the third parameter we are giving the physical location of the file. In the fifth parameter we assign default value for the routes. In the last parameter we define the constrains for the default value for the defined route. Now, in default.aspx.cs, we will call this route and assign it to CustomerRoute navigation url.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic11.png"><img class="alignnone size-full wp-image-46" title="pic11" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic11.png?w=316&#038;h=192" border="0" alt="pic11" width="316" height="192" /></a></p>
<p>Hit F5 and see for yourselves. Similarly we can assign markup variables in aspx page.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic12.png"><img class="alignnone size-full wp-image-47" title="pic12" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic12.png?w=503&#038;h=105" border="0" alt="pic12" width="503" height="105" /></a></p>
<p>The above code is an example of markup language. The hyperlink with id ProfileRoute, in this case we did not assign any route name. As a result, it will automatically take the unnamed route in routecollection.</p>
<p><a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic16.png"><img title="pic16" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic16.png?w=499&#038;h=18" border="0" alt="pic16" width="499" height="18" /></a></p>
<p> In this case unnamed route here is profile. Ok, the last thing left is to catch the routing values. So in the next section, at code level, we will try to catch the parameter that we passed. For this case, we will use Customer.aspx.cs</p>
<p> <a href="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic13.png"><img class="alignnone size-full wp-image-48" title="pic13" src="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic13.png?w=492&#038;h=228" border="0" alt="pic13" width="492" height="228" /></a></p>
<p>Guess I will finish here. Any comments welcome. Next week I will talk about Silverlight Prism and MVVM.</p>
<p>Thanks<br />
Sharker Khaleed Mahmud<br />
MCTS, MCPD<br />
DHAKA, BANGLADESH</p>
<p>References:<br />
<a title="ASP.NET Routing" href="http://msdn.microsoft.com/en-us/library/cc668201(VS.100).aspx">ASP.NET Routing</a><br />
<a href="http://msdn.microsoft.com/en-us/library/system.web.routing.route(VS.100).aspx">Route</a><br />
<a href="http://msdn.microsoft.com/en-us/library/system.web.routing.pageroutehandler(VS.100).aspx">PageRouteHandler</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sharkerkhaleedmahmud.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sharkerkhaleedmahmud.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sharkerkhaleedmahmud.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sharkerkhaleedmahmud.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sharkerkhaleedmahmud.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sharkerkhaleedmahmud.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sharkerkhaleedmahmud.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sharkerkhaleedmahmud.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sharkerkhaleedmahmud.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sharkerkhaleedmahmud.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sharkerkhaleedmahmud.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sharkerkhaleedmahmud.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sharkerkhaleedmahmud.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sharkerkhaleedmahmud.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharkerkhaleedmahmud.wordpress.com&amp;blog=10233307&amp;post=9&amp;subd=sharkerkhaleedmahmud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sharkerkhaleedmahmud.wordpress.com/2009/11/04/url-routing-in-asp-net-the-simplest-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/207815c5b723f2943b1c12154ed3b929?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shamrat231</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic15.png?w=300" medium="image">
			<media:title type="html">pic15</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic2.png" medium="image">
			<media:title type="html">pic2</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic3.png" medium="image">
			<media:title type="html">pic3</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic4.png" medium="image">
			<media:title type="html">pic4</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic5.png" medium="image">
			<media:title type="html">pic5</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic6.png" medium="image">
			<media:title type="html">pic6</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic7.png" medium="image">
			<media:title type="html">pic7</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic8.png" medium="image">
			<media:title type="html">pic8</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic9.png" medium="image">
			<media:title type="html">pic9</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic10.png" medium="image">
			<media:title type="html">pic10</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic11.png" medium="image">
			<media:title type="html">pic11</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic12.png" medium="image">
			<media:title type="html">pic12</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic16.png" medium="image">
			<media:title type="html">pic16</media:title>
		</media:content>

		<media:content url="http://sharkerkhaleedmahmud.files.wordpress.com/2009/11/pic13.png" medium="image">
			<media:title type="html">pic13</media:title>
		</media:content>
	</item>
	</channel>
</rss>
