<?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>Tek Freak</title>
	<atom:link href="http://powerbala.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://powerbala.com</link>
	<description>Switched ON</description>
	<lastBuildDate>Tue, 14 Feb 2012 21:27:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='powerbala.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tek Freak</title>
		<link>http://powerbala.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://powerbala.com/osd.xml" title="Tek Freak" />
	<atom:link rel='hub' href='http://powerbala.com/?pushpress=hub'/>
		<item>
		<title>Extending LightSwitch TextBox : Walk-Through</title>
		<link>http://powerbala.com/2012/01/01/extending-lightswitch-textbox-walk-through/</link>
		<comments>http://powerbala.com/2012/01/01/extending-lightswitch-textbox-walk-through/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 16:41:21 +0000</pubDate>
		<dc:creator>powerbala</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://powerbala.com/?p=292</guid>
		<description><![CDATA[***** WISH YOU A HAPPY NEW YEAR ***** In this post, we&#8217;ll create a simple, LightSwitch &#8216;Character  Casing&#8221; TextBox. This extension will allow us to set following &#8216;case&#8217; Normal Upper Case Lower Case Proper Case Title Case Sentence Case For this walk-through we are creating a &#8220;VALUE&#8221; control. So you have to follow this MSDN article to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=292&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote>
<p style="text-align:center;"><strong>***** WISH YOU A HAPPY NEW YEAR *****</strong></p>
</blockquote>
<p><img class="aligncenter size-full wp-image-306" style="border-color:initial;border-style:initial;" title="Article" src="http://powerbala.files.wordpress.com/2012/01/article.png?w=600" alt=""   /></p>
<p>In this post, we&#8217;ll create a simple, LightSwitch &#8216;<strong>Character </strong><strong> Casing</strong>&#8221; TextBox. This extension will allow us to set following &#8216;case&#8217;</p>
<ul>
<li>Normal</li>
<li>Upper Case</li>
<li>Lower Case</li>
<li>Proper Case</li>
<li>Title Case</li>
<li>Sentence Case</li>
</ul>
<div></div>
<p><span id="more-292"></span></p>
<p>For this walk-through we are creating a &#8220;VALUE&#8221; control. So you have to follow this <strong><a href="http://msdn.microsoft.com/en-us/library/hh290141.aspx" target="_blank">MSDN article</a></strong> to create your start-up project. You also will follow several steps from the same article. Keep that tab open.</p>
<p><strong>Steps:</strong></p>
<p><strong>01. Create a LS Extensible project.</strong> Follow the above article. Name your project as &#8220;<strong>XTextBoxExtension</strong>&#8220;. And name your control as &#8220;<strong>XTextBoxControl</strong>&#8220;.</p>
<p><strong>02. Update the Control Icon</strong>. Follow the article</p>
<p><strong>03. Specify Supported Data Types.</strong> Our control needs to support just &#8220;STRING&#8221; property. So just update this line in your LSML file.</p>
<p><pre class="brush: xml;">
    &lt;Control.SupportedDataTypes&gt;
      &lt;SupportedDataType DataType=&quot;:String&quot; /&gt;
    &lt;/Control.SupportedDataTypes&gt;
</pre></p>
<p><strong>04. Bind to LightSwitch Data.</strong></p>
<p><strong> 05. Allow User Code to Access the Control</strong></p>
<p><strong> 06. Add Read-Only Support. Follow the article.</strong></p>
<p><strong>07. Alright.</strong> We done following that article. Now we need to create a &#8220;<strong>CharacterCasing</strong>&#8221; Property. Go back to your <strong>XTextBoxControl.LSML</strong> file and add this. This section creates a CharacterCasing property, its ENUM values and also a default value. LightSwitch will automatically create a DropDown list with below values.</p>
<p><pre class="brush: xml;">
    &lt;Control.Properties&gt;
      &lt;ControlProperty
                Name=&quot;CharacterCasing&quot;
                PropertyType=&quot;:String&quot;
                CategoryName=&quot;Appearance&quot;
                EditorVisibility=&quot;PropertySheet&quot;&gt;
        &lt;ControlProperty.Attributes&gt;
          &lt;DisplayName Value=&quot;Character Casing&quot; /&gt;
          &lt;Description Value=&quot;Character Casing&quot; /&gt;
          &lt;SupportedValuesExclusive /&gt;
          &lt;SupportedValue DisplayName=&quot;Normal&quot; Value=&quot;Normal&quot;/&gt;
          &lt;SupportedValue DisplayName=&quot;Upper Case&quot; Value=&quot;Upper&quot;/&gt;
          &lt;SupportedValue DisplayName=&quot;Lower Case&quot; Value=&quot;Lower&quot;/&gt;
          &lt;SupportedValue DisplayName=&quot;Proper Case&quot; Value=&quot;ProperCase&quot;/&gt;
          &lt;SupportedValue DisplayName=&quot;Title Case&quot; Value=&quot;TitleCase&quot;/&gt;
          &lt;SupportedValue DisplayName=&quot;Sentence Case&quot; Value=&quot;SentenceCase&quot;/&gt;
        &lt;/ControlProperty.Attributes&gt;

        &lt;ControlProperty.DefaultValueSource&gt;
          &lt;ScreenExpressionTree&gt;
            &lt;ConstantExpression ResultType=&quot;:String&quot; Value=&quot;Normal&quot;/&gt;
          &lt;/ScreenExpressionTree&gt;
        &lt;/ControlProperty.DefaultValueSource&gt;
      &lt;/ControlProperty&gt;
    &lt;/Control.Properties&gt;
</pre></p>
<p>When we deal with String Formats, such as <strong>&#8220;Proper Case&#8221;, &#8220;Title Case&#8221;, or &#8220;Sentence Case&#8221;</strong>, we don&#8217;t have proper rules to follow.  Each one of our requirements might be unique.  So for a greater flexibility, lets add three more Control Properties.</p>
<p><strong>WordSeperators</strong> : We supply a series of &#8220;chars&#8221; as a one single string (no comma delimiters) to determine what might be our word separators.</p>
<p><strong>SentenceSeperators</strong> : Same as above, but this time we declare it for sentences with &#8220;Comma Delimited Values.</p>
<p><strong>ExceptionWords</strong> :  This is for <strong>Title Case</strong> Property.  Title Cases are different from Proper Cases. For example,</p>
<ul>
<li><strong>Title Case</strong> : This is a Sample Title Case.</li>
<li><strong>Proper Case</strong> : This Is A Sample Proper Case</li>
</ul>
<p>On the above, &#8220;is&#8221; &amp; &#8220;a&#8221; need to still maintain their lower case, when it comes to Title Case. The list might vary for what you need.  With ExceptionWords property, we can build our own Exception Dictionary, of course with Comma Delimiters.  Here is the xaml code those three properties. Just add them under &#8220;<strong>Dictionary</strong>&#8221; property. These properties also declared few default values.</p>
<p><pre class="brush: xml;">
      &lt;ControlProperty
                Name=&quot;WordBreakers&quot;
                PropertyType=&quot;:String&quot;
                CategoryName=&quot;Appearance&quot;
                EditorVisibility=&quot;PropertySheet&quot;&gt;
        &lt;ControlProperty.Attributes&gt;
          &lt;DisplayName Value=&quot;Word Breakers List&quot; /&gt;
          &lt;Description Value=&quot;Word Breakers List&quot; /&gt;
        &lt;/ControlProperty.Attributes&gt;

        &lt;ControlProperty.DefaultValueSource&gt;
          &lt;ScreenExpressionTree&gt;
            &lt;ConstantExpression ResultType=&quot;:String&quot; Value=&quot; .!?&quot;/&gt;
          &lt;/ScreenExpressionTree&gt;
        &lt;/ControlProperty.DefaultValueSource&gt;
      &lt;/ControlProperty&gt;

      &lt;ControlProperty
                Name=&quot;SentenceBreakers&quot;
                PropertyType=&quot;:String&quot;
                CategoryName=&quot;Appearance&quot;
                EditorVisibility=&quot;PropertySheet&quot;&gt;
        &lt;ControlProperty.Attributes&gt;
          &lt;DisplayName Value=&quot;Sentence Breakers List (Use Comma)&quot; /&gt;
          &lt;Description Value=&quot;Sentence Breakers List (Use Comma)&quot; /&gt;
        &lt;/ControlProperty.Attributes&gt;

        &lt;ControlProperty.DefaultValueSource&gt;
          &lt;ScreenExpressionTree&gt;
            &lt;ConstantExpression ResultType=&quot;:String&quot; Value=&quot; ,. ,! ,? &quot;/&gt;
          &lt;/ScreenExpressionTree&gt;
        &lt;/ControlProperty.DefaultValueSource&gt;
      &lt;/ControlProperty&gt;

      &lt;ControlProperty
                Name=&quot;ExceptionWords&quot;
                PropertyType=&quot;:String&quot;
                CategoryName=&quot;Appearance&quot;
                EditorVisibility=&quot;PropertySheet&quot;&gt;
        &lt;ControlProperty.Attributes&gt;
          &lt;DisplayName Value=&quot;Exception Words (Use Comma)&quot; /&gt;
          &lt;Description Value=&quot;Exception Words (Use Comma)&quot; /&gt;
        &lt;/ControlProperty.Attributes&gt;

        &lt;ControlProperty.DefaultValueSource&gt;
          &lt;ScreenExpressionTree&gt;
            &lt;ConstantExpression ResultType=&quot;:String&quot; Value=&quot;a,is,was,are,were,been&quot;/&gt;
          &lt;/ScreenExpressionTree&gt;
        &lt;/ControlProperty.DefaultValueSource&gt;
      &lt;/ControlProperty&gt;
</pre></p>
<p><strong>08. Almost done</strong>. Now go to your <strong>XTextBoxControl.xaml</strong> file. Select the textbox and wire-up its &#8220;<strong>TextChanged</strong>&#8221; event. Your updated XAML should be like this now.</p>
<p><pre class="brush: xml;">
    &lt;framework:StatesControl HorizontalAlignment=&quot;Stretch&quot;&gt;
        &lt;TextBox x:Name=&quot;TextBox&quot;
                Text=&quot;{Binding StringValue, Mode=TwoWay}&quot;
                IsReadOnly=&quot;{Binding IsReadOnly}&quot;
                TextAlignment=&quot;{Binding Properties[Microsoft.LightSwitch:RootControl/TextAlignment]}&quot;
                HorizontalAlignment=&quot;Stretch&quot;
                ToolTipService.ToolTip=&quot;{Binding Description}&quot;
                 TextChanged=&quot;TextBox_TextChanged&quot; &gt;
        &lt;/TextBox&gt;
    &lt;/framework:StatesControl&gt;
</pre></p>
<p><strong>09. Now Right Click</strong> on the &#8220;<strong>TextBox_TextChanged</strong>&#8221; text, and click &#8220;<strong>Navigate to Event Handler</strong>&#8220;. That&#8217;ll open the Code Behind file. Update the &#8220;<strong>TextBox_TextChanged</strong>&#8221; event with below code.</p>
<p><pre class="brush: csharp;">
        private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            OnTextChanged();
        }

        private void OnTextChanged()
        {
            TextBox _textBox = this.TextBox;

            int selectionStart = _textBox.SelectionStart;

            if (this.CharacterCasing == &quot;Upper&quot;)
                _textBox.Text = CultureInfo.CurrentCulture.TextInfo.ToUpper(_textBox.Text);
            else if (this.CharacterCasing == &quot;Lower&quot;)
                _textBox.Text = CultureInfo.CurrentCulture.TextInfo.ToLower(_textBox.Text);
            else if (this.CharacterCasing == &quot;ProperCase&quot;)
                _textBox.Text = ProperCase(_textBox.Text);
            else if (this.CharacterCasing == &quot;TitleCase&quot;)
                _textBox.Text = TitleCase(_textBox.Text);
            else if (this.CharacterCasing == &quot;SentenceCase&quot;)
                _textBox.Text = SentenceCase(_textBox.Text);

            _textBox.SelectionStart = selectionStart;
        }

</pre></p>
<p><strong>10. We&#8217;ll use ToUpper &amp; ToLower</strong> inbuilt functions, but we need to create the other methods. Remember, none of these below methods will satisfy 100% of your desire and far from perfect. So you need to work on the code to make it perfect for ur needs.</p>
<p><pre class="brush: csharp;">
        #region Character Case Helpers
        public string ProperCase(string txt)
        {
            string properCaseStr = String.Empty;
            bool isCaps = true;

            foreach (char c in txt.ToCharArray())
            {
                properCaseStr += isCaps ? c.ToString().ToUpper() : c.ToString();
                isCaps = this.WordBreakers.Contains(c.ToString());
            }

            return properCaseStr;
        }

        public string TitleCase(string txt)
        {
            txt = ProperCase(txt);

            string titleCaseStr = String.Empty;
            foreach (string sentenceBreaker in this.SentenceBreakers.Split(','))
            {
                foreach (string titleCaseException in this.ExceptionWords.Split(','))
                {
                    string findWord = String.Empty;

                    //SPACE is not a Sentence Breaker. So change the Non Noun word to lowercase
                    if (sentenceBreaker == &quot; &quot;)
                    {
                        findWord = sentenceBreaker + ProperCase(titleCaseException);
                        txt = txt.Replace(findWord, sentenceBreaker + titleCaseException.ToLower());
                    }
                    else
                    {
                        findWord = sentenceBreaker + titleCaseException.ToLower();
                        txt = txt.Replace(findWord, sentenceBreaker + ProperCase(titleCaseException));
                    }
                }
            }

            return txt;
        }

        public string SentenceCase(string txt)
        {
            string sentenceCaseStr = String.Empty;
            bool isCaps = true;

            char prevChar = char.MinValue;
            foreach (char c in txt.ToCharArray())
            {
                sentenceCaseStr += isCaps ? c.ToString().ToUpper() : c.ToString();
                isCaps = (c == ' ' &amp;&amp; this.WordBreakers.Contains(prevChar));
                prevChar = c;
            }

            return sentenceCaseStr;
        }
        #endregion
</pre></p>
<p><strong>11. Now we need to create</strong> a Local Properties and register them to listen if there is any change on appropriate properties.</p>
<p><pre class="brush: csharp;">
        #region Properties
        public string CharacterCasing
        {
            get { return (string)GetValue(CharacterCasingProperty); }
            set { SetValue(CharacterCasingProperty, value); }
        }

        public string WordBreakers
        {
            get { return (string)GetValue(WordBreakersProperty); }
            set { SetValue(WordBreakersProperty, value); }
        }

        public string SentenceBreakers
        {
            get { return (string)GetValue(SentenceBreakersProperty); }
            set { SetValue(SentenceBreakersProperty, value); }
        }

        public string ExceptionWords
        {
            get { return (string)GetValue(ExceptionWordsProperty); }
            set { SetValue(ExceptionWordsProperty, value); }
        }

        #endregion

        #region Dependency Properties
        public static readonly DependencyProperty CharacterCasingProperty =
            DependencyProperty.Register(&quot;CharacterCasingProperty&quot;,
                                    typeof(string), typeof(XTextBoxControl),
                                    new PropertyMetadata(OnCharacterCasingPropertyChanged));

        public static readonly DependencyProperty WordBreakersProperty =
            DependencyProperty.Register(&quot;WordBreakersProperty&quot;,
                                    typeof(string), typeof(XTextBoxControl),
                                    new PropertyMetadata(OnWordBreakersPropertyChanged));

        public static readonly DependencyProperty SentenceBreakersProperty =
            DependencyProperty.Register(&quot;SentenceBreakersProperty&quot;,
                                    typeof(string), typeof(XTextBoxControl),
                                    new PropertyMetadata(OnSentenceBreakersPropertyChanged));

        public static readonly DependencyProperty ExceptionWordsProperty =
            DependencyProperty.Register(&quot;ExceptionWordsProperty&quot;,
                                    typeof(string), typeof(XTextBoxControl),
                                    new PropertyMetadata(OnExceptionWordsPropertyChanged));
        #endregion

        #region Metadata
        private static void OnCharacterCasingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //Do what you want
        }

        private static void OnWordBreakersPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //Do what you want
        }

        private static void OnSentenceBreakersPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //Do what you want
        }

        private static void OnExceptionWordsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //Do what you want
        }
        #endregion
</pre></p>
<p><strong>12. And finally,</strong> bind the Dependency property from the control&#8217;s constructor.</p>
<p><pre class="brush: csharp;">
        public XTextBoxControl()
        {
            InitializeComponent();
            this.SetBinding(CharacterCasingProperty, new Binding(&quot;Properties[XTextBoxExtension:XTextBoxControl/CharacterCasing]&quot;));
            this.SetBinding(WordBreakersProperty, new Binding(&quot;Properties[XTextBoxExtension:XTextBoxControl/WordBreakers]&quot;));
            this.SetBinding(SentenceBreakersProperty, new Binding(&quot;Properties[XTextBoxExtension:XTextBoxControl/SentenceBreakers]&quot;));
            this.SetBinding(ExceptionWordsProperty, new Binding(&quot;Properties[XTextBoxExtension:XTextBoxControl/ExceptionWords]&quot;));
        }
</pre></p>
<p><strong>THATS IT!!!!!!!! Now test your control.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/powerbala.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/powerbala.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/powerbala.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/powerbala.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/powerbala.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/powerbala.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/powerbala.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/powerbala.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/powerbala.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/powerbala.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/powerbala.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/powerbala.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/powerbala.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/powerbala.wordpress.com/292/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=292&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://powerbala.com/2012/01/01/extending-lightswitch-textbox-walk-through/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4915d82d5628ba657c0569e8b84e9a8b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">powerbala</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2012/01/article.png" medium="image">
			<media:title type="html">Article</media:title>
		</media:content>
	</item>
		<item>
		<title>Background Group Layout Extension</title>
		<link>http://powerbala.com/2011/12/20/background-group-layout-extension/</link>
		<comments>http://powerbala.com/2011/12/20/background-group-layout-extension/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 19:59:00 +0000</pubDate>
		<dc:creator>powerbala</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LightSwitch]]></category>
		<category><![CDATA[LightSwitch Extension]]></category>

		<guid isPermaLink="false">https://powerbala.wordpress.com/?p=284</guid>
		<description><![CDATA[&#160; Introduction This simple group layout extension consists of two controls: ImageLayout &#38; BrushLayout; helps users to set its background. Detail As of I’ve tested, below background types are supported. Image Layout Control Image Brush Layout Control Image Brush Linear Gradient Brush Radial Gradient Brush Solid Color Brush   Both controls supports the following properties [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=284&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3></h3>
<p>&nbsp;</p>
<h1>Introduction</h1>
<p><span style="font-size:small;">This simple group la</span><span style="font-size:small;">yout extension consists of two controls: ImageLayout &amp; BrushLayout; helps users to set its background.</span></p>
<p><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="FullSS" src="http://powerbala.files.wordpress.com/2011/12/fullss_thumb.png?w=542&#038;h=488" alt="FullSS" width="542" height="488" border="0" /></p>
<p><span id="more-284"></span></p>
<h1>Detail</h1>
<p><span style="font-size:small;">As of I’ve tested, below background types are supported.</span></p>
<p><strong><span style="text-decoration:underline;"><span style="font-size:small;">Image Layout Control</span></span></strong></p>
<ul>
<li><span style="font-size:small;"><em>Image</em></span></li>
</ul>
<p><strong><span style="text-decoration:underline;"><span style="font-size:small;">Brush Layout Control</span></span></strong></p>
<ul>
<ul>
<li><span style="font-size:small;"><em>Image Brush</em></span></li>
<li><span style="font-size:small;"><em>Linear Gradient Brush</em></span></li>
<li><span style="font-size:small;"><em>Radial Gradient Brush</em></span></li>
<li><em><span style="font-size:small;">Solid Color Brush</span><strong></strong></em></li>
</ul>
</ul>
<p><span style="font-size:small;"> </span></p>
<p><span style="font-size:small;">Both controls supports the following properties for extra customization. </span></p>
<ul>
<li><span style="font-size:small;"><em>Background [For <strong>ImageLayout</strong> : Valid Image; For <strong>BrushLayout</strong> : Valid <strong>XAML</strong> text]</em></span></li>
<li><span style="font-size:small;"><em>BorderBrush [Predefined values, listed in combobox]</em></span></li>
<li><span style="font-size:small;"><em>BorderThickness [+ Integer : Ex: <strong>2</strong> or <strong>2,2</strong> or <strong>2,2,2,2</strong>]</em></span></li>
<li><span style="font-size:small;"><em>CornerRadius [+ Integer : Ex: <strong>2</strong> or <strong>2,2</strong> or <strong>2,2,2,2</strong>]</em></span></li>
<li><span style="font-size:small;"><em>Margin [+/- Integer : Ex: <strong>2</strong> or <strong>2,-2</strong> or -<strong>2,2,-2,2</strong>]</em></span></li>
<li><span style="font-size:small;"><em>Opacity [+ Decimal : Ex: <strong>0.5</strong>]</em></span></li>
<li><span style="font-size:small;"><em>Padding [+ Integer : Ex: <strong>2</strong> or <strong>2,2</strong> or <strong>2,2,2,2</strong>]</em></span></li>
</ul>
<h1></h1>
<h1>Screenshots</h1>
<p><strong><span style="font-size:small;">Image Background (ImageLayout Control)</span></strong></p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/imagebackground.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="ImageBackground" src="http://powerbala.files.wordpress.com/2011/12/imagebackground_thumb.png?w=244&#038;h=44" alt="ImageBackground" width="244" height="44" border="0" /></a></p>
<p><strong><span style="font-size:small;">Multi Stop Linear Gradient</span></strong></p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/multistoplineargradient.png"><span style="font-size:small;"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="MultiStopLinearGradient" src="http://powerbala.files.wordpress.com/2011/12/multistoplineargradient_thumb.png?w=174&#038;h=244" alt="MultiStopLinearGradient" width="174" height="244" border="0" /></span></a></p>
<p><span style="font-size:small;"><a href="http://powerbala.files.wordpress.com/2011/12/brush-xaml.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="Brush Xaml" src="http://powerbala.files.wordpress.com/2011/12/brush-xaml_thumb.png?w=244&#038;h=45" alt="Brush Xaml" width="244" height="45" border="0" /></a></span></p>
<p><span style="font-size:small;"><strong>Example</strong>: </span></p>
<blockquote><p>&lt;LinearGradientBrush x:Key=&#8221;linear&#8221; StartPoint=&#8221;0,0&#8243; EndPoint=&#8221;1,1&#8243; SpreadMethod=&#8221;Pad&#8221; ColorInterpolationMode=&#8221;SRgbLinearInterpolation&#8221; &gt;&lt;GradientStop Color=&#8221;#FF02A509&#8243; Offset=&#8221;0&#8243; /&gt;&lt;GradientStop Color=&#8221;#FF258931&#8243; Offset=&#8221;1&#8243; /&gt;&lt;GradientStop Color=&#8221;#FFE2FFB6&#8243; Offset=&#8221;0.61&#8243; /&gt;&lt;GradientStop Color=&#8221;#FF7AF35F&#8221; Offset=&#8221;0.29&#8243; /&gt;&lt;/LinearGradientBrush&gt;</p></blockquote>
<p><span style="font-size:small;"><strong>Empty Background</strong></span></p>
<p><span style="font-size:small;">If you don’t supply a Xaml text, then control creates a empty Linear Brush. Shadow effect is created by providing different border properties (Ex: 1,1,5,5).</span></p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/emptybackground.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="EmptyBackground" src="http://powerbala.files.wordpress.com/2011/12/emptybackground_thumb.png?w=265&#038;h=210" alt="EmptyBackground" width="265" height="210" border="0" /></a></p>
<p><strong>Radial Gradient with Opacity</strong></p>
<p>Same as LinearGradient, you can supply a valid RadialGradientBrush Xaml.  For this screenshot, I also applied Opacity (0.5) for dull effect.</p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/radialgradientwithopacity.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="RadialGradientwithOpacity" src="http://powerbala.files.wordpress.com/2011/12/radialgradientwithopacity_thumb.png?w=244&#038;h=191" alt="RadialGradientwithOpacity" width="244" height="191" border="0" /></a></p>
<p><strong>Example</strong></p>
<blockquote><p><span style="font-size:x-small;">&lt;RadialGradientBrush x:Key=&#8221;radial&#8221; Center=&#8221;0.5,0.5&#8243; GradientOrigin=&#8221;0.5,0.5&#8243; RadiusX=&#8221;0.5&#8243; RadiusY=&#8221;0.5&#8243; SpreadMethod=&#8221;Pad&#8221; ColorInterpolationMode=&#8221;SRgbLinearInterpolation&#8221; &gt;&lt;GradientStop Color=&#8221;#FFD700FF&#8221; Offset=&#8221;0&#8243; /&gt;&lt;GradientStop Color=&#8221;#FF642568&#8243; Offset=&#8221;1&#8243; /&gt;&lt;GradientStop Color=&#8221;#FFF9F9F9&#8243; Offset=&#8221;0.5&#8243; /&gt;&lt;/RadialGradientBrush&gt;</span></p></blockquote>
<p><strong>Solid Color with ImageLayout</strong></p>
<p>Remember to pass a HEX value as your color.  Passing Numeric (RGB) values will not work in Silverlight and extension will throw an exception.</p>
<p>For this screenshot, I added ImageLayout control inside a BrushLayout Control.</p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/solidcolorwithinnerimage.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="SolidColorWithInnerImage" src="http://powerbala.files.wordpress.com/2011/12/solidcolorwithinnerimage_thumb.png?w=244&#038;h=232" alt="SolidColorWithInnerImage" width="244" height="232" border="0" /></a></p>
<p><strong>Example</strong></p>
<blockquote><p><span style="font-size:x-small;">&lt;SolidColorBrush Color=&#8221;#ef115f&#8221;/&gt;</span></p></blockquote>
<p><strong>Image Brush</strong></p>
<p>Along with <strong>ImageLayout</strong> control, you can also use <strong>BrushLayout</strong> control to set your background image; this time by passing a ImageBrush Xaml.</p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/imagebrush.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="ImageBrush" src="http://powerbala.files.wordpress.com/2011/12/imagebrush_thumb.png?w=238&#038;h=244" alt="ImageBrush" width="238" height="244" border="0" /></a></p>
<p><strong>Example</strong></p>
<blockquote><p><span style="font-size:x-small;">&lt;ImageBrush x:Key=&#8221;ImgBrush&#8221; ImageSource=&#8221;/TestProject.Client;Component/Resources/avatar.jpg&#8221;/&gt;</span></p></blockquote>
<h1>Points of Interest</h1>
<ul>
<li><strong><a href="http://msdn.microsoft.com/en-us/library/cc189076(v=vs.95).aspx" target="_blank">MSDN explains</a></strong> potential dangerous about passing Xaml as a parameter and load via <strong>XamlReader.Load()</strong>.  So use this extension with caution.</li>
<li>At least for version 1.0, you need to pass your Xaml as <strong>Single Line Text</strong>. My <strong>Background Value Converter</strong> looks for a “ “ (space) in the root element in order to insert a valid Namespace. So please make sure, you add a <strong>x:Key</strong> or some kind of attribute or just a “space” in your supplied Xaml text.</li>
<li>Passing Xaml as text is not ideal for the users. But till the last minute, I tried to create a Gradient Editor, but I’m not any sort of expert at all.  I dropped that idea and tried to create a Multiline textbox.  I partially succeed but, somehow it keep loosing its “line returns” &amp; alignments.  So I decided to leave it as default single-line textbox.</li>
</ul>
<p>I would really appreciate, if someone can make this extension in more user friendly way (ie: creating a <strong>Gradient Editor</strong>).</p>
<h1>Source Code</h1>
<p>Published Here : <a href="http://code.msdn.microsoft.com/Background-Group-Layout-c272f8fb">http://code.msdn.microsoft.com/Background-Group-Layout-c272f8fb</a></p>
<h3>Disclaimer</h3>
<p>My controls, samples and articles are created during my off/free time. The opinions expressed here are MY OWN and are not necessarily those of my employer, partners, customers, friends, or family. ALL content presented AS-IS, for entertainment/educational purposes only with ABSOLUTELY NO WARRANTY expressed or implied.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/powerbala.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/powerbala.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/powerbala.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/powerbala.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/powerbala.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/powerbala.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/powerbala.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/powerbala.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/powerbala.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/powerbala.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/powerbala.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/powerbala.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/powerbala.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/powerbala.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=284&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://powerbala.com/2011/12/20/background-group-layout-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4915d82d5628ba657c0569e8b84e9a8b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">powerbala</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/fullss_thumb.png" medium="image">
			<media:title type="html">FullSS</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/imagebackground_thumb.png" medium="image">
			<media:title type="html">ImageBackground</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/multistoplineargradient_thumb.png" medium="image">
			<media:title type="html">MultiStopLinearGradient</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/brush-xaml_thumb.png" medium="image">
			<media:title type="html">Brush Xaml</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/emptybackground_thumb.png" medium="image">
			<media:title type="html">EmptyBackground</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/radialgradientwithopacity_thumb.png" medium="image">
			<media:title type="html">RadialGradientwithOpacity</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/solidcolorwithinnerimage_thumb.png" medium="image">
			<media:title type="html">SolidColorWithInnerImage</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/imagebrush_thumb.png" medium="image">
			<media:title type="html">ImageBrush</media:title>
		</media:content>
	</item>
		<item>
		<title>LightSwitch Extension : Image Button</title>
		<link>http://powerbala.com/2011/12/04/lightswitch-extension-image-button/</link>
		<comments>http://powerbala.com/2011/12/04/lightswitch-extension-image-button/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 02:24:08 +0000</pubDate>
		<dc:creator>powerbala</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LightSwitch]]></category>
		<category><![CDATA[LightSwitch Extension]]></category>
		<category><![CDATA[Image Button]]></category>

		<guid isPermaLink="false">http://powerbala.com/?p=249</guid>
		<description><![CDATA[Introduction This walkthrough will demonstrate how to create A very simple Button Control extension that consists of two controls; helps users to attach PNG image to their buttons.  ImageButton – this control will allow you attach just an image to the button. ExtendedImageButton – will also show “Display Name” text and wraps. Building the Sample The prerequisites for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=249&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-251 aligncenter" title="Result" src="http://powerbala.files.wordpress.com/2011/12/result.png?w=600&#038;h=405" alt="" width="600" height="405" /></p>
<p><strong>Introduction</strong></p>
<p>This walkthrough will demonstrate how to create A very simple Button Control extension that consists of two controls; helps users to attach PNG image to their buttons.  <strong>ImageButton</strong> – this control will allow you attach just an image to the button. <strong>ExtendedImageButton</strong> – will also show “Display Name” text and wraps.</p>
<p><span id="more-249"></span></p>
<p><strong>Building the Sample</strong></p>
<p>The prerequisites for this sample are:</p>
<ul>
<li><a title="Visual Studio 2010 SP1 (Professional, Premium, or Ultimate edition)" href="http://www.microsoft.com/visualstudio/en-us">Visual Studio 2010 SP1 (Professional, Premium, or Ultimate edition)</a></li>
<li><a title="Visual Studio 2010 SP1 SDK" href="http://www.microsoft.com/download/en/details.aspx?id=21835">Visual Studio 2010 SP1 SDK</a></li>
<li><a title="Visual Studio LightSwitch 2011" href="http://www.microsoft.com/visualstudio/en-us/lightswitch/overview">Visual Studio LightSwitch 2011</a></li>
<li><a title="Visual Studio LightSwitch 2011 Extensibility Toolkit" href="http://go.microsoft.com/fwlink/?LinkId=223396">Visual Studio LightSwitch 2011 Extensibility Toolkit</a></li>
</ul>
<p><strong>Description</strong></p>
<p>Step 1 : Create a new Extension Project. Name it, <strong>ImageButtonExtension</strong></p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/step-1-createextnproject.png"><img class="aligncenter size-full wp-image-252" title="Step 1- Create Extn Project" src="http://powerbala.files.wordpress.com/2011/12/step-1-createextnproject.png?w=600&#038;h=429" alt="" width="600" height="429" /></a></p>
<p>Step 2 : Right click on <strong>LSPKG </strong>project and add a new <strong>Control </strong>Item. Name it :<strong> ImageButton.xaml</strong></p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/step-2-add-new-item.png"><img class="aligncenter size-full wp-image-253" title="Step 2- Add New Item" src="http://powerbala.files.wordpress.com/2011/12/step-2-add-new-item.png?w=600" alt=""   /></a></p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/step-3-add-new-item.png"><img class="aligncenter size-full wp-image-254" title="Step 3 - Add New Item" src="http://powerbala.files.wordpress.com/2011/12/step-3-add-new-item.png?w=600" alt=""   /></a></p>
<p>Step 3 : Open <strong>ImageButton.lsml</strong> file from <strong>COMMON</strong> project and modify it as below.</p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/step-4-open-lsml.png"><img class="aligncenter size-full wp-image-255" title="Step 4 - Open LSML" src="http://powerbala.files.wordpress.com/2011/12/step-4-open-lsml.png?w=600" alt=""   /></a></p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/step-5-modify-lsml.png"><img class="aligncenter size-full wp-image-256" title="Step 5 - Modify LSML" src="http://powerbala.files.wordpress.com/2011/12/step-5-modify-lsml.png?w=600&#038;h=242" alt="" width="600" height="242" /></a></p>
<p><pre class="brush: xml;">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?--&gt;

    &lt;!-- This override will show Image property in designer --&gt;

</pre></p>
<p>Step 4 : Open <strong>ImageButton.xaml</strong> file from <strong>CLIENT</strong> project and edit as below.</p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/step-6-open-control-file.png"><img class="aligncenter size-full wp-image-257" title="Step 6 - Open Control File" src="http://powerbala.files.wordpress.com/2011/12/step-6-open-control-file.png?w=600" alt=""   /></a></p>
<p><a href="http://powerbala.files.wordpress.com/2011/12/stetp-6-1-edit-control-file.png"><img class="aligncenter size-full wp-image-258" title="Stetp 6.1 - Edit Control File" src="http://powerbala.files.wordpress.com/2011/12/stetp-6-1-edit-control-file.png?w=600" alt=""   /></a></p>
<p>Step 5 : Open corresponding CS file of the control and modify the class as below</p>
<p><pre class="brush: csharp;">
    public partial class ImageButton : UserControl
    {
        public ImageButton()
        {
            InitializeComponent();
        }

        private void imgImage_Loaded(object sender, RoutedEventArgs e)
        {
            IContentItem contentItem = (IContentItem)DataContext;
            imgImage.Source = Microsoft.LightSwitch.Presentation.Framework.Helpers.ImagePropertyHelper.GetImageSource(contentItem);
        }

        private void btnImageButton_Click(object sender, RoutedEventArgs e)
        {
            IContentItem contentItem = (IContentItem)this.DataContext;
            Microsoft.LightSwitch.IExecutable executable = (Microsoft.LightSwitch.IExecutable)contentItem.Details;
            if (executable != null &amp;&amp; executable.CanExecuteAsync)
                executable.ExecuteAsync();
        }

    }
</pre></p>
<p>At this point, we have a button control that can take an image and displays.  Now to extend this control with more functionalities, such as <strong>Image + Text + Text Wrap</strong> we follow steps 2-5, by adding another control named &#8220;<strong>ExtendedImageButton</strong>&#8220;.</p>
<p><strong>More Information</strong></p>
<p><em>Following websites and blog posts might help you to understand better than what I tried above. </em></p>
<p><em><a href="http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/62/How-To-Create-a-LightSwitch-Command-Control-Extension-A-Button.aspx">http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/62/How-To-Create-a-LightSwitch-Command-Control-Extension-A-Button.aspx</a></em></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ee256689.aspx">http://msdn.microsoft.com/en-us/library/ee256689.aspx</a></p>
<p><strong>Disclaimer</strong></p>
<p>The opinions expressed here are MY OWN and are not necessarily those of my employer, partners, customers, friends, or family. ALL content presented AS-IS, for entertainment/educational purposes only with ABSOLUTELY NO WARRANTY expressed or implied.</p>
<p><strong>Source code</strong></p>
<p>CODE : <a href="http://code.msdn.microsoft.com/LightSwitch-Image-Button-f9dda668">http://code.msdn.microsoft.com/LightSwitch-Image-Button-f9dda668</a></p>
<p>CONTROL : <a href="http://visualstudiogallery.msdn.microsoft.com/5b064b35-cdf5-46aa-909f-fa43ad98b512">http://visualstudiogallery.msdn.microsoft.com/5b064b35-cdf5-46aa-909f-fa43ad98b512</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/powerbala.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/powerbala.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/powerbala.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/powerbala.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/powerbala.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/powerbala.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/powerbala.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/powerbala.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/powerbala.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/powerbala.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/powerbala.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/powerbala.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/powerbala.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/powerbala.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=249&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://powerbala.com/2011/12/04/lightswitch-extension-image-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4915d82d5628ba657c0569e8b84e9a8b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">powerbala</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/result.png" medium="image">
			<media:title type="html">Result</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/step-1-createextnproject.png" medium="image">
			<media:title type="html">Step 1- Create Extn Project</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/step-2-add-new-item.png" medium="image">
			<media:title type="html">Step 2- Add New Item</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/step-3-add-new-item.png" medium="image">
			<media:title type="html">Step 3 - Add New Item</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/step-4-open-lsml.png" medium="image">
			<media:title type="html">Step 4 - Open LSML</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/step-5-modify-lsml.png" medium="image">
			<media:title type="html">Step 5 - Modify LSML</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/step-6-open-control-file.png" medium="image">
			<media:title type="html">Step 6 - Open Control File</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/12/stetp-6-1-edit-control-file.png" medium="image">
			<media:title type="html">Stetp 6.1 - Edit Control File</media:title>
		</media:content>
	</item>
		<item>
		<title>Steve Jobs (1955 &#8211; 2011)</title>
		<link>http://powerbala.com/2011/10/05/steve-jobs-1955-2011/</link>
		<comments>http://powerbala.com/2011/10/05/steve-jobs-1955-2011/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 00:11:22 +0000</pubDate>
		<dc:creator>powerbala</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://powerbala.com/?p=244</guid>
		<description><![CDATA[My mentor, My guru, May Rest In Peace &#160;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=244&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><strong>My mentor, </strong></p>
<p style="text-align:center;"><strong>My guru, </strong></p>
<p style="text-align:center;"><strong>May Rest In Peace</strong></p>
<p style="text-align:center;"><a href="http://powerbala.files.wordpress.com/2011/10/steve-jobs1.jpg"><img class="aligncenter size-full wp-image-245" title="steve-jobs" src="http://powerbala.files.wordpress.com/2011/10/steve-jobs1.jpg?w=600" alt=""   /></a></p>
<p style="text-align:center;">
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/powerbala.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/powerbala.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/powerbala.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/powerbala.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/powerbala.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/powerbala.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/powerbala.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/powerbala.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/powerbala.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/powerbala.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/powerbala.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/powerbala.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/powerbala.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/powerbala.wordpress.com/244/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=244&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://powerbala.com/2011/10/05/steve-jobs-1955-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4915d82d5628ba657c0569e8b84e9a8b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">powerbala</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/10/steve-jobs1.jpg" medium="image">
			<media:title type="html">steve-jobs</media:title>
		</media:content>
	</item>
		<item>
		<title>Bugging with LightSwitch &#8211; Restricted Deletion</title>
		<link>http://powerbala.com/2011/09/02/bugging-with-lightswitch-restricted-deletion/</link>
		<comments>http://powerbala.com/2011/09/02/bugging-with-lightswitch-restricted-deletion/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 16:48:31 +0000</pubDate>
		<dc:creator>powerbala</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://powerbala.com/?p=205</guid>
		<description><![CDATA[Problem : LS allows a master record to be deleted (in screen) even though the entity has few children exist with &#8220;Restricted&#8221; relationship between them.  But it generates the validation error when we try to save the entity and there is no way to get rid of them (by design). Summery : In LS &#8220;Beta2&#8243; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=205&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong> : LS allows a master record to be deleted (in screen) even though the entity has few children exist with &#8220;Restricted&#8221; relationship between them.  But it generates the validation error when we try to save the entity and there is no way to get rid of them (by design).</p>
<p><strong>Summery</strong> : In LS &#8220;Beta2&#8243; days, I posted a bug and <strong><a href="http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/081099b2-4365-4a30-8914-68a6566e7600" target="_blank">acknowledged by LS Team</a></strong>. Now I created a project to see if this bug was cleared. It actually did (now LS assigns &#8220;1&#8243; as a starting number of ID entities), but found another issue with it.  And I&#8217;m not sure, whether this one was pre-exist in Beta2 or not.</p>
<p>On Screen Level, even if my entities&#8217; relationship has &#8216;Restricted&#8217; deletion, LS actually allows to delete the Master record when there are child records exist and it catch this when the records are trying to post back to DB with SAVE method.</p>
<p>If we try to delete an &#8220;existing Master record&#8221;, at least now we have a choice to go back and delete the child records one-by-one on the screen, as LS put a &#8220;X&#8221; icon next to the master record, but at least it still exist in the screen.</p>
<p>But if we delete a newly added master record with children (that are not exist in DB), now LS clears the master/child records from the SCREEN and there is no way to get rid of its validation errors, when we try to SAVE the screen.</p>
<p>You can see these series of screen shot of what I mean.</p>
<a href="http://powerbala.com/2011/09/02/bugging-with-lightswitch-restricted-deletion/#gallery-1-slideshow">Click to view slideshow.</a>
<p><strong>Workaround</strong> : Right now, all what I did was restrict Master&#8217;s deletion method by overriding its code with below.  What I expect from LS is that, it should capture this &#8216;Restricted&#8217; association on the screen and should prevent deletion.</p>
<p><pre class="brush: csharp;">
partial void TempProductListDeleteSelected_CanExecute(ref bool result)
{
    if (TempProducts.SelectedItem == null)
       return;
    if (TempProducts.SelectedItem.TempOrderDetails.Count() &amp;gt; 0)
       result = false;
    else
       result = true;
}
</pre></p>
<p><strong>Discussion Threads</strong></p>
<p><a href="https://connect.microsoft.com/VisualStudio/feedback/details/686639/bug-in-master-detail-deletion#details" target="_blank">https://connect.microsoft.com/VisualStudio/feedback/details/686639/bug-in-master-detail-deletion#details</a></p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/e65b634e-c1f2-471e-9a8c-33507cd59020" target="_blank">http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/e65b634e-c1f2-471e-9a8c-33507cd59020</a></p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/081099b2-4365-4a30-8914-68a6566e7600" target="_blank">http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/081099b2-4365-4a30-8914-68a6566e7600</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/powerbala.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/powerbala.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/powerbala.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/powerbala.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/powerbala.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/powerbala.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/powerbala.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/powerbala.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/powerbala.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/powerbala.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/powerbala.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/powerbala.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/powerbala.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/powerbala.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=205&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://powerbala.com/2011/09/02/bugging-with-lightswitch-restricted-deletion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4915d82d5628ba657c0569e8b84e9a8b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">powerbala</media:title>
		</media:content>
	</item>
		<item>
		<title>Self/Circular Reference in LightSwitch</title>
		<link>http://powerbala.com/2011/08/30/selfcircular-reference-in-lightswitch/</link>
		<comments>http://powerbala.com/2011/08/30/selfcircular-reference-in-lightswitch/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 04:37:37 +0000</pubDate>
		<dc:creator>powerbala</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LightSwitch]]></category>
		<category><![CDATA[Circular Reference]]></category>
		<category><![CDATA[Self Reference]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://powerbala.com/?p=179</guid>
		<description><![CDATA[Difficulty : Beginner Summery: This is a stripped version of JaimeH&#8217;s MSDN&#8217;s code sample.  All credit goes to him.  I&#8217;m following Slideshow presentation idea from my previous post and matched the bullet points with it.  Hope this article may help someone. Problem: How do you create a self/circular reference table and not to show the current record on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=179&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty</strong> : Beginner</p>
<p><strong><br />
Summery: </strong>This is a stripped version of <strong><a title="JaimeH's MSDN code sample" href="http://code.msdn.microsoft.com/A-way-to-handle-a-simple-dbba9ff1" target="_blank">JaimeH&#8217;s MSDN&#8217;s code sample</a></strong>.  All credit goes to him. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I&#8217;m following Slideshow presentation idea from my previous post and matched the bullet points with it.  Hope this article may help someone.</p>
<p><strong><br />
Problem: </strong>How do you create a self/circular reference table and not to show the current record on its &#8216;drop down&#8217; control?  For example, you have a Category Table with a ParentCategoryId that reference itself (which should allow NULL).  Now when you assign a Category for it, you may don&#8217;t want to allow the same Category to be assigned to itself.</p>
<p><strong><span id="more-179"></span><br />
Slideshow</strong></p>
<a href="http://powerbala.com/2011/08/30/selfcircular-reference-in-lightswitch/#gallery-2-slideshow">Click to view slideshow.</a>
<p><strong><br />
Bullets</strong></p>
<ul>
<li>Create a project and add a table named &#8220;Category&#8221; with Name field. Also create a Relationship with <strong>Many &lt;-&gt; One or Zero</strong></li>
<li>Create a Query named &#8220;GetParents&#8221;.  Create a parameter named &#8220;ParentId&#8221; and assign it to Id filter with &#8220;<strong>&lt;&gt;</strong>&#8220;</li>
<li>Create a &#8220;Editable Grid Screen&#8221; for Category</li>
<li>Create a &#8220;List and Details Screen&#8221; for Category.</li>
<li>On the &#8220;List and Details Screen&#8221;, click &#8220;Add Data Item&#8221; and select &#8220;GetParents&#8221; query</li>
<li>Select ParentId on the left &amp; bind to &#8220;Categories.SelectedItem.Id&#8221;</li>
<li>Select ParentId drop down control and change its choices from &#8220;Auto&#8221; to &#8220;GetParents&#8221;</li>
<li>Run the project and add few Categories. Don&#8217;t worry about ParentId for now. Save the screen</li>
<li>Select &#8220;Category List Details&#8221; page and now you see your selected Category won&#8217;t showup on your ParentId.</li>
</ul>
<p>Now why did I create a &#8220;List and Details&#8221; page in order to assign ParentId, rather than assign it on the &#8220;Editable Data Grid&#8221;? is what you see on the last image. It requires to save the data into DB in order, the filter query to take effect. So, you can even do this without creating a second page, but you have to make sure that you save your Category before you assign it&#8217;s parent.</p>
<p><strong><br />
Discussion Threads</strong></p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/97cdea32-4551-423b-8782-7fe71f19a640">http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/97cdea32-4551-423b-8782-7fe71f19a640</a></p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/6c5272d5-f619-48df-88a5-f3e16672ad88">http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/6c5272d5-f619-48df-88a5-f3e16672ad88</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/powerbala.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/powerbala.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/powerbala.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/powerbala.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/powerbala.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/powerbala.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/powerbala.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/powerbala.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/powerbala.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/powerbala.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/powerbala.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/powerbala.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/powerbala.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/powerbala.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=179&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://powerbala.com/2011/08/30/selfcircular-reference-in-lightswitch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4915d82d5628ba657c0569e8b84e9a8b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">powerbala</media:title>
		</media:content>
	</item>
		<item>
		<title>Calling a 3rd Party Web Service From LightSwitch</title>
		<link>http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/</link>
		<comments>http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 21:50:32 +0000</pubDate>
		<dc:creator>powerbala</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">http://powerbala.com/?p=96</guid>
		<description><![CDATA[Summary: This post will show you how to call a 3rd party web service methods from LightSwitch using WCF RIA.  For this demo post, I chose WebserviceX.NET&#8217;s Zipcode WebService (http://www.webservicex.net/uszip.asmx)  and thanks to their service. I have matched the bulleted points with Slideshow. Discussion Thread : http://social.msdn.microsoft.com/Forums/en/lightswitchgeneral/thread/876090da-3670-481b-90de-e34998a610b3 Steps: Create a LightSwitch Application Add a New [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=96&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<a href="http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/#gallery-3-slideshow">Click to view slideshow.</a>
<h2>Summary:</h2>
<p>This post will show you how to call a 3rd party web service methods from LightSwitch using WCF RIA.  For this demo post, I chose WebserviceX.NET&#8217;s Zipcode WebService (<strong>http://www.webservicex.net/uszip.asmx</strong>)  and thanks to their service. I have matched the bulleted points with Slideshow.<br />
<span id="more-96"></span></p>
<h2>Discussion Thread :</h2>
<p><a href="http://social.msdn.microsoft.com/Forums/en/lightswitchgeneral/thread/876090da-3670-481b-90de-e34998a610b3">http://social.msdn.microsoft.com/Forums/en/lightswitchgeneral/thread/876090da-3670-481b-90de-e34998a610b3</a></p>
<h2>Steps:</h2>
<p>Create a LightSwitch Application</p>
<ul>
<li>Add a<strong> New Project</strong></li>
<li>Name it &#8220;<strong>ZipcodeRIAService</strong>&#8220;</li>
<li>On  <strong>ZipcodeRIAService.Web</strong> project,</li>
<ol>
<ul>
<li>Right Click on <strong>References</strong></li>
<li>Add <strong>Service Reference</strong></li>
<li>Click <strong>Advanced</strong></li>
<li>Click <strong>Add Web Reference</strong></li>
</ul>
</ol>
<li>Type your WebService address (for this ex: http://www.webservicex.net/uszip.asmx) and name it ZipcodeWebRef</li>
<li>On the same project &#8220;<strong><em>Add a new item</em></strong>&#8221; -&gt; &#8220;<em><strong>Domain Service Class</strong></em>&#8220;. Name it &#8220;<strong>ZipcodeDomainService</strong>&#8220;</li>
<li>When the new window popup, uncheck &#8220;<strong>Enable client access</strong>&#8221; (up to your pref.) . Click OK</li>
<li>The example webservice generates nodes like this one for all type of searches.  So we need to create a class to represent these nodes.</li>
</ul>
<p><pre class="brush: csharp;">
namespace ZipcodeRIAService.Web
{
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ServiceModel.DomainServices.Server;
    using System.Xml;
    using ZipcodeRIAService.Web.ZipcodeWebRef;

    //This node class to represent the webservice's output model
    public sealed class WebServiceNode
    {
        //LS requires at least one Key field. So make Zip column as Key
        [Key]
        public string Zip { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string Area { get; set; }
        public string TimeZone { get; set; }

        //return a new class
        public static WebServiceNode CreateNew(XmlNode node)
        {
            return new WebServiceNode
            {
                City = node.ChildNodes[0].InnerText,
                State = node.ChildNodes[1].InnerText,
                Zip = node.ChildNodes[2].InnerText,
                Area = node.ChildNodes[3].InnerText,
                TimeZone = node.ChildNodes[4].InnerText
            };
        }
    }

    //Data Helper
    public sealed class Converter
    {
        public static IEnumerable SelectAllCities(XmlNode xDoc)
        {
            //This enables the XmlNode Type to enumerate
            IEnumerator cities = xDoc.GetEnumerator();
            while (cities.MoveNext())
                yield return WebServiceNode.CreateNew((XmlNode)cities.Current);
        }
    }

    public class ZipcodeDomainService : DomainService
    {
        //LS requires a default parameterless query function
        //or a skeleton class to return
        [Query(IsDefault = true)]
        public IEnumerable FakeFunction()
        {
            return SelectCity(&quot;&quot;);
        }

        //This is the function we need to call from LS
        [Query]
        public IEnumerable SelectCity(string cityname)
        {
            //Instantiate USZip class from WebService Provider and pass city name
            return Converter.SelectAllCities(new USZip().GetInfoByCity(cityname));
        }
    }
}
</pre></p>
<ul>
<li>Once you finish it, build the project</li>
<li>Back to our LS project, right click on Data Sources and &#8220;<strong>Add Data Source</strong>&#8220;</li>
<li>Select <strong>WCF RIA Service</strong></li>
<li>Under Project&#8217;s tab, select<strong> ZipcodeRIAService.Web</strong> class</li>
<li>Select the Service class and click <strong>Next</strong></li>
<li>Select the <strong>Entity </strong>and<strong> Finish</strong></li>
<li>Our WebServiceNode entity</li>
<li>Now right click on Screen and Add Screen</li>
<li>Select Editable Grid Screen (your pref.) and select &#8220;<strong>SelectCity</strong>&#8221; as Screen Data</li>
<li>LS will automatically create a textbox for you and bind that textbox with entity&#8217;s<strong> Cityname</strong> parameter.  Right click on the textbox and &#8220;<strong>Add Button</strong>&#8220;</li>
<li>Give a method name for the button, (here <strong>ZipcodeLookupMethod</strong>).</li>
</ul>
<p><pre class="brush: csharp;">
namespace LightSwitchApplication
{
    public partial class EditableSelectCityGrid
    {
        partial void ZipcodeLookupMethod_Execute()
        {
            // On the next step, we will remove Auto Execute option from Entity.
            // The this.Details.Properties..Loader.Load() method
            // will run the data source query on demand.
           if (!string.IsNullOrEmpty(WebServiceNodecityname))
               if (WebServiceNodecityname.Trim().Length &gt; 0)
                    this.Details.Properties.SelectCity.Loader.Load();
        }
    }
}
</pre></p>
<ul>
<li>On the left most side, click <strong>SelectCity</strong> and clear &#8220;Auto Execute Query&#8221; and Support Paging&#8221; checkboxes.</li>
<li>Now run the project. Type your city on the textbox&#8230;&#8230; and happy no coding.! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Note : If you want to support the paging for your custom RIA Data Source, then you have to override the Count method of your domain class. You can add the below code to support paging.</p>
<p><pre class="brush: csharp;">

        // using System.Linq;
        protected override int Count(IQueryable query)
        {
            return query.Count();
        }
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/powerbala.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/powerbala.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/powerbala.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/powerbala.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/powerbala.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/powerbala.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/powerbala.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/powerbala.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/powerbala.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/powerbala.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/powerbala.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/powerbala.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/powerbala.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/powerbala.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=96&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4915d82d5628ba657c0569e8b84e9a8b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">powerbala</media:title>
		</media:content>
	</item>
		<item>
		<title>Many-To-Many Control for Microsoft LightSwitch</title>
		<link>http://powerbala.com/2011/04/10/many-to-many-control-for-microsoft-lightswitch/</link>
		<comments>http://powerbala.com/2011/04/10/many-to-many-control-for-microsoft-lightswitch/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 05:28:36 +0000</pubDate>
		<dc:creator>powerbala</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">http://powerbala.com/?p=18</guid>
		<description><![CDATA[Result Problem I needed a Many-To-Many control that can help our users to relate hundreds of records between two master tables. Out of the box, LightSwitch (Beta 1/2) doesn&#8217;t support either Multi-Row Select Data Grid or provided a CheckedListBox. LS provides one in-built solution for M2M: Auto Complete Box :- But this will take long time [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=18&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Result</h2>
<div id="attachment_50" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/01-result1.jpg"><img class="size-full wp-image-50" title="01. Result" src="http://powerbala.files.wordpress.com/2011/04/01-result1.jpg?w=600&#038;h=424" alt="" width="600" height="424" /></a><p class="wp-caption-text">Result</p></div>
<h2>Problem</h2>
<p>I needed a <strong>Many-To-Many</strong> control that can help our users to relate hundreds of records between two master tables. Out of the box, LightSwitch (Beta 1/2) doesn&#8217;t support either Multi-Row Select Data Grid or provided a CheckedListBox.<br />
LS provides one in-built solution for M2M: <strong>Auto Complete Box</strong> :- But this will take long time to add few hundred related data and requires multiple clicks per record. Also LS Team and community give two workarounds:<br />
<span id="more-18"></span></p>
<ul>
<li><strong><a href="http://blogs.msdn.com/b/lightswitch/archive/2010/12/16/how-to-create-a-many-to-many-relationship-andy-kung.aspx" target="_blank">Andy Kung&#8217;s Many-To-Many Relationship </a></strong>: Claims lot of screen real estate. And if you have hundreds of records on both tables, you&#8217;ll be confused which one is been already on the grid.</li>
<li>Add a <strong>IsSelected </strong>bool field on each master table  (saw this suggestion on the forum) : Closest one. But it requires adding an additional bool field on each master table, which is not possible (at least in my case).</li>
</ul>
<h2>Solution</h2>
<p>Even though LS doesn&#8217;t provide a proper M2M control &amp; support Stored Procedures natively, it supports adding custom Silverlight controls and WCF RIA services. In my case, all I need is a datagrid with a bool column.  So I decided to write a WCF RIA service that gives me an Entity the way I want and use the existing Data Grid control.  But this idea will work with your custom control too. Lets begin&#8230;.</p>
<h2>Steps</h2>
<p>Create a databased named &#8220;<strong>Movies</strong>&#8221; in SQLEXPRESS and add few <em>MOVIES &amp; GENRES</em> data. (You can create the modal in LS designer too. Just make sure, you add few data for testing)</p>
<div id="attachment_51" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/02-modal.jpg"><img class="size-full wp-image-51" title="02. Modal" src="http://powerbala.files.wordpress.com/2011/04/02-modal.jpg?w=600&#038;h=413" alt="" width="600" height="413" /></a><p class="wp-caption-text">Modal</p></div>
<p>&nbsp;</p>
<p>In Visual Studio, create a new LightSwitch (C#) project. Name it <em><strong>ManyToManyMovieGenre</strong></em>.</p>
<div id="attachment_52" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/03-createsolution.jpg"><img class="size-full wp-image-52" title="03. CreateSolution" src="http://powerbala.files.wordpress.com/2011/04/03-createsolution.jpg?w=600&#038;h=415" alt="" width="600" height="415" /></a><p class="wp-caption-text">Create Solution</p></div>
<p>&nbsp;</p>
<p>Add a new data source to &#8220;<strong>Movies</strong>&#8221; database.</p>
<p><a href="http://powerbala.files.wordpress.com/2011/04/04-connection.jpg"><img class="aligncenter size-full wp-image-53" title="04. Connection" src="http://powerbala.files.wordpress.com/2011/04/04-connection.jpg?w=600" alt=""   /></a></p>
<p>Select only <em><strong>Movie &amp; Genre</strong></em> tables.  <span style="text-decoration:underline;">Leave MovieGenre table unselected.</span></p>
<div id="attachment_54" class="wp-caption aligncenter" style="width: 585px"><a href="http://powerbala.files.wordpress.com/2011/04/05-tableselect.jpg"><img class="size-full wp-image-54" title="05.TableSelect" src="http://powerbala.files.wordpress.com/2011/04/05-tableselect.jpg?w=600" alt=""   /></a><p class="wp-caption-text">Table Selection</p></div>
<p>Now add a new &#8220;WCF RIA Services Class Library&#8221; project. Name it <strong>MovieRIAServicesLibrary</strong>.</p>
<div id="attachment_55" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/06-riaproject.jpg"><img class="size-full wp-image-55" title="06. RIAProject" src="http://powerbala.files.wordpress.com/2011/04/06-riaproject.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a><p class="wp-caption-text">Create New RIA Project</p></div>
<p>Add a &#8220;<strong>Domain Service Class</strong>&#8221; file to &#8220;<strong>MovieRIAServicesLibrary.Web</strong>&#8221; project. Name it &#8220;<strong>MovieRIADomainService</strong>&#8220;.</p>
<p><a href="http://powerbala.files.wordpress.com/2011/04/07-domain-service-class.jpg"><img class="aligncenter size-full wp-image-58" title="07. Domain Service Class" src="http://powerbala.files.wordpress.com/2011/04/07-domain-service-class.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p>When a new window popup, uncheck &#8220;<strong>Enable client access</strong>&#8221; and click OK.</p>
<div id="attachment_59" class="wp-caption aligncenter" style="width: 470px"><a href="http://powerbala.files.wordpress.com/2011/04/08-domain-service.jpg"><img class="size-full wp-image-59" title="08. Domain Service" src="http://powerbala.files.wordpress.com/2011/04/08-domain-service.jpg?w=600" alt=""   /></a><p class="wp-caption-text">Add Service Class</p></div>
<p>Now enter the following code into <strong>MovieRIADomainServices.cs</strong> file.</p>
<p><pre class="brush: csharp;">

//Code inspired by Tejana's solution.
//http://www.tejana.com/Home/Blog/tabid/71/EntryId/15/Microsoft-LightSwitch-and-WCF-RIA-Services.aspx
//http://www.tejana.com/Home/Blog/tabid/71/EntryId/16/Stored-Procedures-in-LightSwitch.aspx

namespace MovieRIAServicesLibrary.Web
{
    using System.Collections.Generic;
    using System.ServiceModel.DomainServices.Server;
    using System.Data.SqlClient;
    using System.Data;
    using System.ComponentModel.DataAnnotations;

    public class MovieGenre
    {
        [Key]
        public int MovieId { get; set; }

        [Key]
        public int GenreId { get; set; }

        public string GenreName { get; set; }

        public bool IsSelected { get; set; }

        public static MovieGenre CreateNew(IDataRecord iDR)
        {
            return new MovieGenre
            {
                MovieId = (int)iDR[&quot;MovieId&quot;],
                GenreId = (int)iDR[&quot;GenreId&quot;],
                GenreName = (string)iDR[&quot;GenreName&quot;],
                IsSelected = (bool)iDR[&quot;IsSelected&quot;]
            };
        }
    }

    public class MovieGenreData
    {
        static string sConnString = @&quot;YOUR CONNECTION STRING GOES HERE&quot;;

        public static IEnumerable SelectGenres(int? mID)
        {
            SqlCommand sComm = new SqlCommand();
            sComm.CommandType = CommandType.Text; //you can change this to Stored Procedure
            sComm.Parameters.AddWithValue(&quot;MovieId&quot;, mID);

            // Original idea of this SQL command's idea belongs to someone in the net.
            // I grabbed it years ago and modified it.
            // This SQL brings all record from Parent and a TRUE/FALSE field depends on its availability from Child
            sComm.CommandText = @&quot;SELECT g.Id AS GenreId, @MovieId AS MovieId, g.Name AS GenreName,
                                        CASE WHEN
                                            mg.MovieId IS NULL
                                        THEN
                                            CAST (0 AS BIT)
                                        ELSE
                                            CAST (1 AS BIT)
                                        END AS IsSelected
                                  FROM
                                        Genre AS g LEFT OUTER JOIN
                                            MovieGenre AS mg ON
                                                g.Id = mg.GenreId AND
                                                mg.MovieId = @MovieId&quot;;

            using (SqlConnection sConn = new SqlConnection(sConnString))
            {
                sComm.Connection = sConn;
                sConn.Open();

                SqlDataReader sDataReader = sComm.ExecuteReader();
                if (sDataReader.HasRows)
                    while (sDataReader.Read())
                        yield return MovieGenre.CreateNew(sDataReader);
                sConn.Close();
            }
        }

        public static void InsertMovieGenre(int mID, int gID)
        {
            SqlConnection sConn = new SqlConnection(sConnString);
            SqlCommand sComm = new SqlCommand();
            sComm.CommandType = CommandType.Text;               //you can change this to Stored Procedure
            sComm.Parameters.AddWithValue(&quot;MovieId&quot;, mID);
            sComm.Parameters.AddWithValue(&quot;GenreId&quot;, gID);

            sComm.CommandText = @&quot;INSERT INTO MovieGenre (MovieId, GenreId) VALUES (@MovieId, @GenreId)&quot;;

            sComm.Connection = sConn;
            sConn.Open();
            sComm.ExecuteNonQuery();
            sConn.Close();
        }

        public static void DeleteMovieGenre(int mID, int gID)
        {
            SqlConnection sConn = new SqlConnection(sConnString);
            SqlCommand sComm = new SqlCommand();
            sComm.CommandType = CommandType.Text;               //you can change this to Stored Procedure
            sComm.Parameters.AddWithValue(&quot;MovieId&quot;, mID);
            sComm.Parameters.AddWithValue(&quot;GenreId&quot;, gID);

            sComm.CommandText = @&quot;DELETE MovieGenre WHERE MovieId = @MovieId AND GenreId = @GenreId&quot;;

            sComm.Connection = sConn;
            sConn.Open();
            sComm.ExecuteNonQuery();
            sConn.Close();
        }
    }

    public class MovieRIADomainService : DomainService
    {
        //Fake Function to satisfy WCF RIA requirement
        [Query(IsDefault = true)]
        public IEnumerable SelectFakeGenres()
        {
            return MovieGenreData.SelectGenres(-1);
        }

        //Made mID as NULLABLE to satisfy WCF RIA requirement
        [Query]
        public IEnumerable SelectGenres(int? mID)
        {
            return MovieGenreData.SelectGenres(mID);
        }

        [Insert]
        public void CreateMovieGenre(MovieGenre mg)
        {
            MovieGenreData.InsertMovieGenre(mg.MovieId, mg.GenreId);
        }

        [Update]
        public void UpdateMovieGenre(MovieGenre mg)
        {
            DeleteMovieGenre(mg);
            if (mg.IsSelected)
                CreateMovieGenre(mg);
        }

        [Delete]
        public void DeleteMovieGenre(MovieGenre mg)
        {
            MovieGenreData.DeleteMovieGenre(mg.MovieId, mg.GenreId);
        }
    }
}

</pre></p>
<p><strong>Build the WCF RIA project. </strong>Back in LS Project (<strong>ManyToManyMovieGenre</strong>), add a &#8220;WCF RIA Service&#8221; data source.</p>
<div id="attachment_62" class="wp-caption aligncenter" style="width: 585px"><a href="http://powerbala.files.wordpress.com/2011/04/09-wcf-ria-project.jpg"><img class="size-full wp-image-62" title="09. WCF RIA Project" src="http://powerbala.files.wordpress.com/2011/04/09-wcf-ria-project.jpg?w=600" alt=""   /></a><p class="wp-caption-text">Select WCF RIA</p></div>
<p>Click Add Reference.  Under Projects tab, select &#8220;<strong>MovieRIAServicesLibrary.Web</strong>&#8221; project.</p>
<div id="attachment_60" class="wp-caption aligncenter" style="width: 492px"><a href="http://powerbala.files.wordpress.com/2011/04/10-addprojectref.jpg"><img class="size-full wp-image-60" title="10. AddProjectRef" src="http://powerbala.files.wordpress.com/2011/04/10-addprojectref.jpg?w=600" alt=""   /></a><p class="wp-caption-text">Add Web Project as Ref</p></div>
<p>Select <em><strong>MovieGenre</strong></em> from Entities list.</p>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 585px"><a href="http://powerbala.files.wordpress.com/2011/04/12-moviegenreentity.jpg"><img class="size-full wp-image-63" title="12. MovieGenreEntity" src="http://powerbala.files.wordpress.com/2011/04/12-moviegenreentity.jpg?w=600" alt=""   /></a><p class="wp-caption-text">Entity Selection</p></div>
<p>Add a List and Details Screen to <em><strong>Movies</strong></em>.</p>
<div id="attachment_65" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/13-moviegenrescreenselect1.jpg"><img class="size-full wp-image-65" title="13. MovieGenreScreenSelect" src="http://powerbala.files.wordpress.com/2011/04/13-moviegenrescreenselect1.jpg?w=600&#038;h=394" alt="" width="600" height="394" /></a><p class="wp-caption-text">Add a List &amp; Detail screen to Movie</p></div>
<p>Add <strong>SelectGenres</strong> Data Item to the screen</p>
<div id="attachment_66" class="wp-caption aligncenter" style="width: 510px"><a href="http://powerbala.files.wordpress.com/2011/04/14-addselectgenre.jpg"><img class="size-full wp-image-66" title="14. AddSelectGenre" src="http://powerbala.files.wordpress.com/2011/04/14-addselectgenre.jpg?w=600" alt=""   /></a><p class="wp-caption-text">Add Select Genre Data Item to the screen</p></div>
<p>Map<strong> mID parameter</strong> to<em><strong> Movies.SelectedItem.Id</strong></em></p>
<div id="attachment_67" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/15-map-parameter.jpg"><img class="size-full wp-image-67" title="15. Map parameter" src="http://powerbala.files.wordpress.com/2011/04/15-map-parameter.jpg?w=600&#038;h=461" alt="" width="600" height="461" /></a><p class="wp-caption-text">Parameter Mapping</p></div>
<p>Add a <strong>Rows Layout</strong> group under<strong> Details Column Layout</strong>.</p>
<div id="attachment_69" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/16-add-row-layout.jpg"><img class="size-full wp-image-69" title="16. Add Row Layout" src="http://powerbala.files.wordpress.com/2011/04/16-add-row-layout.jpg?w=600&#038;h=596" alt="" width="600" height="596" /></a><p class="wp-caption-text">Add Row Layout</p></div>
<p>Then add <strong>SelectGenres</strong> Datagrid to this new group. Delete all other columns except <strong>IsSelected &amp; GenreName</strong>.  Change GenreName&#8217;s control from Textbox to Label.</p>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/17-add-selectgenre.jpg"><img class="size-full wp-image-70" title="17. Add SelectGenre" src="http://powerbala.files.wordpress.com/2011/04/17-add-selectgenre.jpg?w=600&#038;h=596" alt="" width="600" height="596" /></a><p class="wp-caption-text">Add Select Genre to screen</p></div>
<p>If you run the application at this time, you can see all genres will listed out but the grid shows as Read-Only. This is because, LS Screen keeps only one data source with read/write permission.</p>
<div id="attachment_71" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/18-readonly.jpg"><img class="size-full wp-image-71" title="18. ReadOnly" src="http://powerbala.files.wordpress.com/2011/04/18-readonly.jpg?w=600&#038;h=510" alt="" width="600" height="510" /></a><p class="wp-caption-text">Read Only Data Grid</p></div>
<p>Now you have two options.</p>
<p>1. If you don&#8217;t want make any changes on Movie&#8217;s details, then&#8230;&#8230;</p>
<p>Select &#8220;<strong>Save</strong>&#8221; method from the left grid. Change the data source from <em><strong>MoviesData</strong></em> to <em><strong>MoviesRIADomainServiceData</strong></em>.</p>
<div id="attachment_72" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/19-change-datasource.jpg"><img class="size-full wp-image-72" title="19. Change Datasource" src="http://powerbala.files.wordpress.com/2011/04/19-change-datasource.jpg?w=600&#038;h=474" alt="" width="600" height="474" /></a><p class="wp-caption-text">Change Data Source</p></div>
<p>If you run the application now, you can see the read-only columns shifted to Movie Details, but the MovieGenre data grid become editatble.</p>
<div id="attachment_73" class="wp-caption aligncenter" style="width: 610px"><a href="http://powerbala.files.wordpress.com/2011/04/20-shifted-readonly.jpg"><img class="size-full wp-image-73" title="20. Shifted ReadOnly" src="http://powerbala.files.wordpress.com/2011/04/20-shifted-readonly.jpg?w=600&#038;h=475" alt="" width="600" height="475" /></a><p class="wp-caption-text">Shifted Read Only Data Source</p></div>
<p>2. If you want to make both data sources editable, then Click &#8220;Write Code&#8221; from the top the screen, select MoviesListDetail_InitializeDataWorkspace and this code.</p>
<div id="attachment_74" class="wp-caption aligncenter" style="width: 590px"><a href="http://powerbala.files.wordpress.com/2011/04/21-writecode.jpg"><img class="size-full wp-image-74" title="21. WriteCode" src="http://powerbala.files.wordpress.com/2011/04/21-writecode.jpg?w=600" alt=""   /></a><p class="wp-caption-text">Write Code</p></div>
<p><pre class="brush: csharp;">
partial void MoviesListDetail_InitializeDataWorkspace(List saveChangesTo)
{
// Depends on what source you selected as default on the screen, add the second source here
saveChangesTo.Add(DataWorkspace.MovieRIADomainServiceData);
}
</pre></p>
<p>Again go back to Designer page, and on &#8220;Write Code&#8221;, click MoviesListDetail_Saving and add this code.</p>
<p><pre class="brush: csharp;">
partial void MoviesListDetail_Saving(ref bool handled)
{
// Write your code here.
DataWorkspace.MoviesData.SaveChanges();
DataWorkspace.MovieRIADomainServiceData.SaveChanges();
handled = true;
}
</pre></p>
<p>Now  if you run the application, you can see that both data sources are in write mode, and you can make changes on both and save them to database.</p>
<p>THE END. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Credits</h2>
<p>Discussions/Help received links&#8230;&#8230;&#8230;.</p>
<p><a href="http://social.msdn.microsoft.com/Forums/en/lightswitchgeneral/thread/0acaa406-61d5-4180-9a98-c23b644520f8">http://social.msdn.microsoft.com/Forums/en/lightswitchgeneral/thread/0acaa406-61d5-4180-9a98-c23b644520f8</a></p>
<p><a href="http://social.msdn.microsoft.com/Forums/en/lightswitchgeneral/thread/56d836b4-3d1c-4205-8178-6af175d02f27">http://social.msdn.microsoft.com/Forums/en/lightswitchgeneral/thread/56d836b4-3d1c-4205-8178-6af175d02f27</a></p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/1ccd5fb6-1e1d-48d1-9b4c-e2c9628a3eb1">http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/1ccd5fb6-1e1d-48d1-9b4c-e2c9628a3eb1</a></p>
<p><a href="http://www.tejana.com/Home/Blog/tabid/71/EntryId/15/Microsoft-LightSwitch-and-WCF-RIA-Services.aspx">http://www.tejana.com/Home/Blog/tabid/71/EntryId/15/Microsoft-LightSwitch-and-WCF-RIA-Services.aspx</a></p>
<p><a href="http://www.tejana.com/Home/Blog/tabid/71/EntryId/16/Stored-Procedures-in-LightSwitch.aspx">http://www.tejana.com/Home/Blog/tabid/71/EntryId/16/Stored-Procedures-in-LightSwitch.aspx</a></p>
<p style="text-align:center;"><strong>Thank you LightSwitch team for a such a wonderful concept &amp; tool!</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/powerbala.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/powerbala.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/powerbala.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/powerbala.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/powerbala.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/powerbala.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/powerbala.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/powerbala.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/powerbala.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/powerbala.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/powerbala.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/powerbala.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/powerbala.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/powerbala.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=powerbala.com&amp;blog=5135060&amp;post=18&amp;subd=powerbala&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://powerbala.com/2011/04/10/many-to-many-control-for-microsoft-lightswitch/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4915d82d5628ba657c0569e8b84e9a8b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">powerbala</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/01-result1.jpg" medium="image">
			<media:title type="html">01. Result</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/02-modal.jpg" medium="image">
			<media:title type="html">02. Modal</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/03-createsolution.jpg" medium="image">
			<media:title type="html">03. CreateSolution</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/04-connection.jpg" medium="image">
			<media:title type="html">04. Connection</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/05-tableselect.jpg" medium="image">
			<media:title type="html">05.TableSelect</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/06-riaproject.jpg" medium="image">
			<media:title type="html">06. RIAProject</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/07-domain-service-class.jpg" medium="image">
			<media:title type="html">07. Domain Service Class</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/08-domain-service.jpg" medium="image">
			<media:title type="html">08. Domain Service</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/09-wcf-ria-project.jpg" medium="image">
			<media:title type="html">09. WCF RIA Project</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/10-addprojectref.jpg" medium="image">
			<media:title type="html">10. AddProjectRef</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/12-moviegenreentity.jpg" medium="image">
			<media:title type="html">12. MovieGenreEntity</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/13-moviegenrescreenselect1.jpg" medium="image">
			<media:title type="html">13. MovieGenreScreenSelect</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/14-addselectgenre.jpg" medium="image">
			<media:title type="html">14. AddSelectGenre</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/15-map-parameter.jpg" medium="image">
			<media:title type="html">15. Map parameter</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/16-add-row-layout.jpg" medium="image">
			<media:title type="html">16. Add Row Layout</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/17-add-selectgenre.jpg" medium="image">
			<media:title type="html">17. Add SelectGenre</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/18-readonly.jpg" medium="image">
			<media:title type="html">18. ReadOnly</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/19-change-datasource.jpg" medium="image">
			<media:title type="html">19. Change Datasource</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/20-shifted-readonly.jpg" medium="image">
			<media:title type="html">20. Shifted ReadOnly</media:title>
		</media:content>

		<media:content url="http://powerbala.files.wordpress.com/2011/04/21-writecode.jpg" medium="image">
			<media:title type="html">21. WriteCode</media:title>
		</media:content>
	</item>
	</channel>
</rss>
