<?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/"
	>

<channel>
	<title>Nessy &#187; Silverlight</title>
	<atom:link href="http://www.nessy.com.ar/blog/category/silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nessy.com.ar/blog</link>
	<description>All you need is code</description>
	<lastBuildDate>Sun, 07 Feb 2010 20:51:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>C#3.0, LINQ / Expresiones Lambda</title>
		<link>http://www.nessy.com.ar/blog/2009/05/22/c30-linq-expresiones-lambda/</link>
		<comments>http://www.nessy.com.ar/blog/2009/05/22/c30-linq-expresiones-lambda/#comments</comments>
		<pubDate>Fri, 22 May 2009 15:39:08 +0000</pubDate>
		<dc:creator>Nessy</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.nessy.com.ar/blog/?p=81</guid>
		<description><![CDATA[
LINQ - Language Integrated Query / Expresiones Lambda
Introducido en la versión 3.0 de .NET, LINQ nos permite realizar consultas similar a las de SQL en nuestro código.
Lambda es una forma de escribir funciones anónimas en el cual se lo suele usar para pasar con facilidad como argumentos y para crear delegados.
Todo esto combinado con el [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nessy.com.ar/blog/wp-content/uploads/2009/05/c3-linq-lambda.jpg" alt="c#3.0 - linq - lambda" title="c#3.0 - linq - lambda" width="456" height="185" class="alignnone size-full wp-image-142" /></p>
<p><b>LINQ - Language Integrated Query / Expresiones Lambda</b></p>
<p>Introducido en la versión 3.0 de .NET, LINQ nos permite realizar consultas similar a las de SQL en nuestro código.</p>
<p>Lambda es una forma de escribir funciones anónimas en el cual se lo suele usar para pasar con facilidad como argumentos y para crear delegados.</p>
<p>Todo esto combinado con el uso de los genéricos hace que el código sea simple.</p>
<p>Veamos un ejemplo de código con LINQ:</p>
<pre class="brush: csharp; gutter: false; toolbar: false;">
	Ficha ficha = (from child in Children.OfType&lt;Ficha&gt;()
				   where child.Name == &quot;_1&quot;
				   select child).First&lt;Ficha&gt;() as Ficha;
</pre>
<p>La sintaxis es idéntica al SQL, en este caso necesitábamos extraer un elemento de tipo "Ficha" con el nombre "_1" de la propiedad "Children" que devuelve una colección de objetos (En Silverlight, "Children" es una propiedad que representa un contenedor de donde desprende los elementos gráficos que se muestra en pantalla).</p>
<p>Ahora ajustando el mismo código con una expresión Lambda:</p>
<pre class="brush: csharp; gutter: false;">
	Ficha ficha = Children
				  .OfType&lt;Ficha&gt;()
				  .Where(child =&gt; child.Name == &quot;_1&quot;)
				  .First&lt;Ficha&gt;();
</pre>
<p>o simplificandolo mas:</p>
<pre class="brush: csharp; gutter: false;">
	Ficha ficha = Children
				  .OfType&lt;Ficha&gt;()
				  .Single(child =&gt; child.Name == &quot;_1&quot;);
</pre>
<p>Todo muy lindo pero el ejemplo que propuse no creo que sorprenda a los programadores Flash dado que a nivel funcional lo que quiero hacer es equivalente a "getChildByName". Osea en código AS3 seria:</p>
<pre class="brush: as3; gutter: false; toolbar: false;">
var ficha:Ficha = this.getChildByName(&quot;_1&quot;) as Ficha;
</pre>
<p><b>Leer XML con Silverlight 2</b></p>
<p>Lo que sigue ahora, sí es impresionante, el ejemplo que propongo a continuación es con Silverlight 2 y se trata de leer un XML con LINQ.</p>
<p>Tengo el XML siguiente, sites.xml:</p>
<pre class="brush: xml; gutter: false;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;main&gt;
	&lt;sites&gt;
		&lt;site
			name=&quot;Blog&quot;
			link=&quot;http://www.nessy.com.ar/blog&quot;
			thumb=&quot;thumb.blog.jpg&quot; /&gt;
		&lt;site
			name=&quot;LinkedIn&quot;
			link=&quot;http://www.linkedin.com/in/FranciscoRosales&quot;
			thumb=&quot;thumb.linkedin.jpg&quot; /&gt;
		&lt;site
			name=&quot;Twitter&quot;
			link=&quot;http://www.twitter.com/nessy&quot;
			thumb=&quot;thumb.twitter.jpg&quot; /&gt;
	&lt;/sites&gt;
&lt;/main&gt;
</pre>
<p>En consecuencia tengo el objeto siguiente:</p>
<pre class="brush: csharp; gutter: false;">
using System;

namespace NessyJackSL.model
{
	public class Site
	{
		public string name { get; set; }

		public string link { get; set; }

		public string thumb { get; set; }
	}
}
</pre>
<p>Y finalmente tengo la clase llamada JackData que se encargará de leer el XML:</p>
<pre class="brush: csharp; gutter: false;">
using System;
using System.Net;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using NessyJackSL.util;
using NessyJackSL.model;

namespace NessyJackSL.data
{
	public class JackData
	{
		public event EventHandler EVENT_DATA_READY;

		public static Site[] sites;

		public JackData()
		{
			try
			{
				WebClient client = new WebClient();
				client.OpenReadAsync(new Uri(&quot;sites.xml&quot;, UriKind.Relative));
				client.OpenReadCompleted += new OpenReadCompletedEventHandler(onComplete);
			}
			catch (Exception ex)
			{
				Log.w(&quot;JackData.Error &gt; &quot; + ex.Message);
			}
		}

		private void onComplete(object sender, OpenReadCompletedEventArgs evt)
		{
			XDocument doc = XDocument.Load((Stream) evt.Result);
			sites = (from site in doc.Descendants(&quot;site&quot;)
					 select new Site
					 {
						name = site.Attribute(&quot;name&quot;).Value,
						link = site.Attribute(&quot;link&quot;).Value,
						thumb = site.Attribute(&quot;thumb&quot;).Value
					 }).ToArray();
			EVENT_DATA_READY(this, new EventArgs());
		}
	}
}
</pre>
<p>Presten atención a lo que se hace en el código siguiente extraido de la clase JackData:</p>
<pre class="brush: csharp; gutter: false;">
			XDocument doc = XDocument.Load((Stream) evt.Result);
			sites = (from site in doc.Descendants(&quot;site&quot;)
					 select new Site
					 {
						name = site.Attribute(&quot;name&quot;).Value,
						link = site.Attribute(&quot;link&quot;).Value,
						thumb = site.Attribute(&quot;thumb&quot;).Value
					 }).ToArray();
</pre>
<p>Una vez cargado el XML sites.xml, estas pocas líneas de código efectúan las acciones siguientes:<br />
recorre los nodos con nombre "site", crea un objeto asignándole el valor que proviene del atributo que le corresponde por cada nodo encontrado y se lo agrega al Array, al final devuelve un Array de Site.</p>
<p>Ahora también lo podemos hacer con la combinación de la expresión Lambada:</p>
<pre class="brush: csharp; gutter: false;">
			sites = doc
					.Descendants(&quot;site&quot;)
					.Select(
						site =&gt; new Site
						{
							name = site.Attribute(&quot;name&quot;).Value,
							link = site.Attribute(&quot;link&quot;).Value,
							thumb = site.Attribute(&quot;thumb&quot;).Value
						}
					).ToArray();
</pre>
<p>Mi polémica  afirmación es que no he visto esta simplicidad en ningún otro lenguaje de programación conocidos pero existen desarrollos en curso para adaptarlos a los lenguajes mas populares.</p>
<p>Las opciones para Java son Quare (<a href="http://quaere.codehaus.org/" target="_blank">http://quaere.codehaus.org/</a>) y JLinq (<a href="http://www.hugoware.net/" target="_blank">http://www.hugoware.net/</a>).</p>
<p>Para ActionScript 3 es GAIQL (<a href="http://g-unix.com/blog/1/2008/05/Actionscript-Intergrated-Query-Language-Preview-Release.cfm" target="_blank">http://g-unix.com/blog/1/2008/05/Actionscript-Intergrated-Query-Language-Preview-Release.cfm</a>).</p>
<p>Para PHP se llama PHPLinq (<a href="http://phplinq.codeplex.com/" target="_blank">http://phplinq.codeplex.com/</a>).</p>
<p>Javascript parece tener su Lambda: <a href="http://alex.dojotoolkit.org/2009/05/on-js-lambdas/" target="_blank">http://alex.dojotoolkit.org/2009/05/on-js-lambdas/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nessy.com.ar/blog/2009/05/22/c30-linq-expresiones-lambda/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apollo, Silverlight y JavaFX</title>
		<link>http://www.nessy.com.ar/blog/2007/07/25/apollo-silverlight-y-javafx/</link>
		<comments>http://www.nessy.com.ar/blog/2007/07/25/apollo-silverlight-y-javafx/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 13:03:18 +0000</pubDate>
		<dc:creator>Nessy</dc:creator>
				<category><![CDATA[Apollo]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Technologia]]></category>

		<guid isPermaLink="false">http://nessy4flash.wordpress.com/2007/07/25/apollo-silverlight-y-javafx/</guid>
		<description><![CDATA[En el link adjunto se encuentra un articulo con una tabla comparativa de los principales framework RIA.
http://ttlnews.blogspot.com/2007/05/test_22.html
]]></description>
			<content:encoded><![CDATA[<p>En el link adjunto se encuentra un articulo con una tabla comparativa de los principales framework RIA.</p>
<p><a href="http://ttlnews.blogspot.com/2007/05/test_22.html">http://ttlnews.blogspot.com/2007/05/test_22.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nessy.com.ar/blog/2007/07/25/apollo-silverlight-y-javafx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight C#, Streaming</title>
		<link>http://www.nessy.com.ar/blog/2007/05/15/silverlight-c-streaming/</link>
		<comments>http://www.nessy.com.ar/blog/2007/05/15/silverlight-c-streaming/#comments</comments>
		<pubDate>Tue, 15 May 2007 13:52:57 +0000</pubDate>
		<dc:creator>Nessy</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Technologia]]></category>

		<guid isPermaLink="false">http://nessy4flash.wordpress.com/2007/05/15/silverlight-c-streaming/</guid>
		<description><![CDATA[
Tremenda buena noticia para Silverlight:
Es posible pasar por alto el uso de Javascript para programar con C#, esto se harÃ¡ por medio de un archivo DLL en el cual se tendra que hacer referencia en el documento XAML.
La performance sera sin lugar a dudad muy alta.
Igualmente quedarÃ¡ la dudad de como se ejecuta una DLL [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nessy.com.ar/blog/wp-content/uploads/2007/05/silverlight_logo_small.gif" alt="Silverlight Smal Logo" /></p>
<p>Tremenda buena noticia para Silverlight:<br />
Es posible pasar por alto el uso de <strong>Javascript</strong> para programar con <strong>C#</strong>, esto se harÃ¡ por medio de un archivo <strong>DLL</strong> en el cual se tendra que hacer referencia en el documento <strong>XAML</strong>.<br />
La performance sera sin lugar a dudad muy alta.<br />
Igualmente quedarÃ¡ la dudad de como se ejecuta una <strong>DLL</strong> a traves de un browser del lado cliente.</p>
<p>Otra buena noticia: <strong>Silverlight Streaming Service</strong> gratis. <a href="http://silverlight.live.com/">http://silverlight.live.com/</a><br />
El servicio de Streaming de Microsoft es gratis para el hosteo de aplicaciones de Silverlight tendremos <strong>4 GB libre</strong> para pruebas de ejecuciÃ³n de video (WMV).</p>
<p>Fuente: <a href="http://www.frogdesign.com/frogblog/microsoft-makes-all-the-right-moves-with-silverlight.html">http://www.frogdesign.com/frogblog/...</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nessy.com.ar/blog/2007/05/15/silverlight-c-streaming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight 1.1 Referencia</title>
		<link>http://www.nessy.com.ar/blog/2007/05/14/silverlight-11-referencia/</link>
		<comments>http://www.nessy.com.ar/blog/2007/05/14/silverlight-11-referencia/#comments</comments>
		<pubDate>Mon, 14 May 2007 19:10:34 +0000</pubDate>
		<dc:creator>Nessy</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Technologia]]></category>

		<guid isPermaLink="false">http://nessy4flash.wordpress.com/2007/05/14/silverlight-11-referencia/</guid>
		<description><![CDATA[http://download.microsoft.com/download/f/2/e/f2ecc2ad-c498-4538-8a2c-15eb157c00a7/SL_Map_FinalNET.png
Con ese poster de referencia de desarolladores de Silverlight 1.1 la cosas van por el buen camino.
Aunque que lejos en algÃºn otro aspecto tecnico: el XAML Silverlight no acepta Javascript namespace (http://www.lazycoder.com/weblog/index.php/archives/2007...).
]]></description>
			<content:encoded><![CDATA[<p><a href="http://download.microsoft.com/download/f/2/e/f2ecc2ad-c498-4538-8a2c-15eb157c00a7/SL_Map_FinalNET.png">http://download.microsoft.com/download/f/2/e/f2ecc2ad-c498-4538-8a2c-15eb157c00a7/SL_Map_FinalNET.png</a></p>
<p>Con ese poster de referencia de desarolladores de Silverlight 1.1 la cosas van por el buen camino.</p>
<p>Aunque que lejos en algÃºn otro aspecto tecnico: el XAML Silverlight no acepta Javascript namespace (<a href="http://www.lazycoder.com/weblog/index.php/archives/2007/05/03/confirmed-silverlight-xaml-cant-use-namespaced-js-handlers/">http://www.lazycoder.com/weblog/index.php/archives/2007...</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nessy.com.ar/blog/2007/05/14/silverlight-11-referencia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merengue de Technologia Adobe y Microsoft</title>
		<link>http://www.nessy.com.ar/blog/2007/05/03/merengue-de-technologia-adobe-y-microsoft/</link>
		<comments>http://www.nessy.com.ar/blog/2007/05/03/merengue-de-technologia-adobe-y-microsoft/#comments</comments>
		<pubDate>Thu, 03 May 2007 17:49:46 +0000</pubDate>
		<dc:creator>Nessy</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Technologia]]></category>

		<guid isPermaLink="false">http://nessy4flash.wordpress.com/2007/05/03/merengue-de-technologia-adobe-y-microsoft/</guid>
		<description><![CDATA[Una pregunta interesante fue redactada por un desarollador .NETero (http://www.lazycoder.com/weblog/).
"... lo que realmente busco es un grÃ¡fico que me pueda informar sobre las technologÃ­as que tendria que usar en mi prÃ³ximo proyecto. ASP.NET + AJAX ? Silverlight? WPF? ..."
A lo cual debido al lugar donde se posteo este comentario (pro Flash) una persona (JesterXL) comenta:
"Quien [...]]]></description>
			<content:encoded><![CDATA[<p>Una pregunta interesante fue redactada por un desarollador .NETero (http://www.lazycoder.com/weblog/).</p>
<p><font color="#326598">"... lo que realmente busco es un grÃ¡fico que me pueda informar sobre las technologÃ­as que tendria que usar en mi prÃ³ximo proyecto. ASP.NET + AJAX ? Silverlight? WPF? ..."</font></p>
<p>A lo cual debido al lugar donde se posteo este comentario (pro Flash) una persona (JesterXL) comenta:</p>
<p><font color="#326598">"Quien dijo que era mas fÃ¡cil con Adobe ?".</font></p>
<p>John Dowdell empleado de Adobe responde dandole soluciones proveniente de Adobe y<br />
de una forma hironica tambien las de Microsoft:</p>
<p><font color="#326598">"Flex para interfaces cliente estructurada, Flash para formulario visual mas libre<br />
...</font><br />
<font color="#326598">En tanto el panorama con Microsoft puede ser un poco diferente,<br />
...</font><br />
<font color="#326598">Hay un WPF para las PC con Vista corriendo en optima condiciones.</font><br />
<font color="#326598">Asimismo hay un WPF para las PC con Vista con bajo rendimiento y WinXP,<br />
</font><font color="#326598">en los navegadores se ejecutaria la logica de Javascript (etapa Beta),<br />
</font><font color="#326598">asimismo tambien habria la logica de Microsoft (etapa Alpha),<br />
</font><font color="#326598">y posiblemente tambien en los navegadores con la logica de Microsoft y interactuando con</font><br />
<font color="#326598">Python o Ruby con algo de DOM (todavia ni aparecio la fase Alpha)...</font></p>
<p><font color="#326598">Hay tambien una historia de HTML/JS."</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nessy.com.ar/blog/2007/05/03/merengue-de-technologia-adobe-y-microsoft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Silverlight</title>
		<link>http://www.nessy.com.ar/blog/2007/04/16/microsoft-silverlight/</link>
		<comments>http://www.nessy.com.ar/blog/2007/04/16/microsoft-silverlight/#comments</comments>
		<pubDate>Mon, 16 Apr 2007 19:25:20 +0000</pubDate>
		<dc:creator>Nessy</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Technologia]]></category>

		<guid isPermaLink="false">http://nessy4flash.wordpress.com/2007/04/16/microsoft-silverlight/</guid>
		<description><![CDATA[Microsoft Silverlight -&#62; WPF/E platform (Windows Presentation Foundation / Everywhere)

Se ha lanzado una versiÃ³n preliminar del destronador de Adobe Flash.
Esta technologÃ­a multiplataforma permite crear aplicaciones Web incluyendo contenido como grafico vectorial, animaciones, video, texto legible.
Muchos ejemplos anduvieron mal con Firefox.
Un dato interesante: no es la primera vez que Microsoft intenta competir con Flash, en el [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft Silverlight -&gt; WPF/E platform (Windows Presentation Foundation / Everywhere)</p>
<p><img src="http://www.nessy.com.ar/blog/wp-content/uploads/2007/04/logo_micosoft_silverlight.gif" alt="Microsoft Silverlight" border="0" /></p>
<p>Se ha lanzado una versiÃ³n preliminar del destronador de Adobe Flash.<br />
Esta technologÃ­a multiplataforma permite crear aplicaciones Web incluyendo contenido como grafico vectorial, animaciones, video, texto legible.<br />
Muchos ejemplos anduvieron mal con Firefox.</p>
<p>Un dato interesante: no es la primera vez que Microsoft intenta competir con Flash, en el aÃ±o 1998 Microsoft lanzÃ³ <a href="http://www.microsoft.com/mind/1198/liquid/liquid.asp" target="_blank">Microsoft Liquid Motion</a>.</p>
<p>Punto <font color="#00aa00">positivo</font>:<br />
- Basado en la plataforma de .NET Framework.<br />
- Plugin liviano &gt; 1.2 Mb<br />
- Se integra en el Visual Studio .NET para los desarolladores.<br />
- ImplementaciÃ³n en nuestra aplicacion como un cliente JavaScript o XHTML.<br />
- Los videos leido por esta technologia pueden estar albergados en cualquier servidor.</p>
<p>Punto <font color="#aa0000">negativo</font>:<br />
- En los ejemplos se hice un uso intensivo de Javascript.<br />
- Comportamiento distintos segÃºn los navegadores.<br />
- Hace uso de XMLHTTP para traer datos de XML.</p>
<p>Link: <a href="http://www.microsoft.com/silverlight/" target="_blank">http://www.microsoft.com/silverlight/</a></p>
<p>En el link siguiente encontrarÃ¡n el plugin para ejectuarlo en los navegadores.<br />
<a href="http://www.microsoft.com/silverlight/downloads.aspx" target="_blank"> http://www.microsoft.com/silverlight/downloads.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nessy.com.ar/blog/2007/04/16/microsoft-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
