Site: http://www.silverlightplayground.org/ Link: http://feeds.feedburner.com/SilverlightPlayground
by via Silverlight & XAML Playground on 1/12/2012 11:52:41 PM
Implicit data templates are a new interesting feature of Silverlight 5.0. They are a new way to create templates that automatically applies to specific types. So, imagine you have a set of types defined, and you want to present a collection of them inside an ItemsControl, you can use an Implicit Template that apply to each one of the types you are binding. Automatically this template will be applied to the give type every time it appear in the collection. As you can figure out if may become rea ...
[ read more ]
by via Silverlight & XAML Playground on 1/2/2012 1:40:25 AM
I would like to start this post saying I'm not a game development expert. During the first times of my work with computers I've been fashinated by the matter but I never gone deep on this development branch. Once I've meet the first time Silverlight 5.0 and I known about the 3D programming the first idea I had is to create a very simple maze as the one someone could write as the basis of a 3D game. In this post I want to briefly illustrate the work you can download at the end of the text. Here y ...
by via Silverlight & XAML Playground on 12/9/2011 9:25:11 PM
Just a few minutes ago I’ve received the good news about the release of Silverlight 5.0 RTW. This is the release many of us are expecting for the end of the year as stated in some previous events. Silverlight 5.0 is a great big step forward on the development of business applications due to a number of improvements introduced in this technology. These improvements involve full-trust, databinding, P/Invoke, Multiple windows and the introduction of the new 3d API based on XNA. For a complete lis ...
by via Silverlight & XAML Playground on 6/29/2011 9:43:23 AM
In my last post I wrote about writing a TCP server using the Reactive Extensions library. It was not a Silverlight related post, but it simply introduces the server side component that I will use in this post to show you how to use the same library to consume the incoming data and present it in Silverlight. The interesting part is to understand how rx can simplify the programming model when dealing with asynchronicity both in Silverlight and in server side full .NET programming. The server I pr ...
by via Silverlight & XAML Playground on 6/17/2011 2:17:05 PM
I know, from the title of this post you may understand that the topic I’m about to cover is not really Silverlight related. Please be patient and it will become clear that there is a relation with Silverlight in the next part when I will complete my exposition. After a long pause, today I return to the Reactive Extensions, I’ve temporarily shelved for lack of time, and I want to present the implementation of a little server that uses a socket and takes advantage of the Extensions. A socket ser ...
by via Silverlight & XAML Playground on 5/4/2011 10:57:43 PM
Continuing my experiments with Reactive Extension I put together a small example that show an alternative use of the library to create a little game. The game is the widely known Snake that many of us have played on his own Nokia when it is the sole game in the ancient models. Please take note that the game I wrote is not complete since it is first of all an example of the use of a technology and how it can simplify the development of a slightly complex logic like the one that is behind this gam ...
by via Silverlight & XAML Playground on 4/23/2011 12:54:32 AM
Starting from Silverlight 5.0 you can create custom Markup Extensions and this is an interesting feature to easily encapsulate some logic and make it easy to be applied to properties in the XAML markup. Until now you could only use a few extensions to apply resources (StaticResource), make databinding (Binding) and connect properties with parts of a template (TemplateBinding) but now, implementing a really simple interface you can build your own. 1: public interface IMarkupEx ...
by via Silverlight & XAML Playground on 4/13/2011 7:24:00 PM
Following the announcement made today on the scene on MIX 2011 I’ve prepared an example for the purpose of showing the new powerful 3D available in the beta bits. Remembering ancient days when I enjoyed myself writing small programs to plot 3D functions on the screen of my Amiga 500, I decided to follow again this path and put together a few lines of code to draw the sample functions in Silverlight (so this pairs with the fractals experiments made in occasion of MIX 2009). Drawing 3D scene ...
by via Silverlight & XAML Playground on 4/4/2011 4:18:45 PM
One interesting feature of Reactive Extensions is the combining of Observables. There are a number of extension methods made to combine two or more streams; Amb, Concat, SelectMany, Merge, Zip, CombineLatest, all these methods are made to take, multiple and non necessarily omogeneous, streams and combine them in a unique resulting stream based on different rules. Here a brief resume of the rules applied from every method Amb returns the stream that start providing va ...
by Andrea Boschin via Silverlight & XAML Playground on 4/1/2011 2:19:47 PM
Today @saldoukhov pointed me to an alternative (and possibly regular) way to implement TrailWithCount, different from the version I introduced yesterday in my latest post. This tecnique invole the use of a bunch of methods from the Reactive Extensions and, at first sight may result more simple and straightforward. Also if @saldoukhov pointed to the sole count version it is also possibile to write a TrailWithTime this way. Here is the new implementation of these methods: 1: // BE AWAR ...
by Andrea Boschin via Silverlight & XAML Playground on 3/30/2011 4:11:10 PM
In my most recent post I've show a new way to write methods to call network resources like feeds, WCF methods and so on. I've proposed two solution that take advantage of Reactive Extension to call operations that follow the Begin-End pattern and also operation that use an event driven pattern. Today I would like to make another step forward to make the event driven side of the problem more reliable. Most of the times when you call the network you deal with this pattern instead of the Begin-End. ...
by codeblock via Silverlight & XAML Playground on 3/30/2011 1:17:20 AM
Recently I’m trying the Reactive Extensions, an interesting set of extensions that aim to improve the handling of asynchronous programming with an innovative implementation of the observer pattern. These extensions provide some useful methods that solve in an elegant way some recurring problems that everyone have found for sure when calling the network. So, after lot of attempts I found a pattern I will start to use implementing the Data Access facade in my Silverlight applications. Before disc ...
by Andrea Boschin via Silverlight & XAML Playground on 2/21/2011 11:26:16 PM
Continuing of my series about IApplicationServices I would like to propose a base class I've created to easily develop Application Services that runs a thread. There are lot of cases when you implement IApplicationService to run a parallel task that accomplish some kind of background tasks. I've collected all the redundant code inside a class I called ThreadedService. Extending this class you have a thread automatically started and stopped according with the application lifetime. Here is the cla ...
by Andrea Boschin via Silverlight & XAML Playground on 2/17/2011 4:35:03 PM
In my last post about injection of ApplicationServices with MEF I've presented a simple solution that allows people to adds instances of ApplicationServices, without the need of adding the markup to the App.xaml file. The solution was interesting as a demonstration of how MEF works, but after some tests and some feedbacks I had I realized it is not applicable in a real world solution because of a subtle problem. The problem is given by a conflict in the lifetime of the application between the ...
by Andrea Boschin via Silverlight & XAML Playground on 2/17/2011 9:44:39 AM
My last post has opened to some unexpected questions about what may seems a strangeness in my code. I was surprised about this questions, just because I believed it was a known pattern, so I decided to give an explanation to ones that does not know the reason I wrote some lines of code in the constructor 1: public class SampleService : IApplicationService 2: { 3: public static SampleService Current { get; private set; } 4: 5: ...
by codeblock via Silverlight & XAML Playground on 2/6/2011 10:33:47 PM
For an example I'm writing for my next presentation at the end of February, I’m trying to build an application skeleton that have lot of extensibility points and my goal is to make almost everything pluggable. An interesting thing I did today is to inject in the application a number of ApplicationServices. The application services are an useful tool to have application-wide services available during the entire lifetime, and they are very easy to create and install. First of all you have to imple ...
by Andrea Boschin via Silverlight & XAML Playground on 2/2/2011 4:46:26 PM
About two weeks ago I started a series of articles about the Windows Phone 7 hosted by the well knows site SilverlightShow. In the very first rows of the opening article I wrote: "Starting with this article we will follow a path to discover one by one all the aspects of this device". The intent of the series is infact to give a walkthrough, starting from scratch, about the brand new device that is born in the previous months. Now we are at the third number of the series and after hav ...
by codeblock via Silverlight & XAML Playground on 1/24/2011 10:56:00 PM
Some days ago I released my second application for the Windows Phone. Probably it mean something I had a Windows Mobile device for the last four years and I never tried to write a single row of code and since last December, when I got my brand new HD7, I already wrote and published two applications. The true story is that the hard part in realizing an application for Windows Phone 7 is to find a good idea. Discarded the possibility of making something unique the sole thing that you can do is try ...
by Andrea Boschin via Silverlight & XAML Playground on 1/24/2011 1:49:54 PM
Recently I'm working hard with Expression Blend to create some interfaces starting from some Illustrator mockups, made by a designer and also creating the user interface of some Windows Phone 7 applications I developed. One thing I've found annoying is that once you create a shape and you rotate it in the designer, Blend uses a CompositeTransform to render the shape in the XAML markup. If you are creating lot of elements (in my case they were the ticks of a gauge) you can get lot of transformati ...
by Andrea Boschin via Silverlight & XAML Playground on 1/19/2011 11:28:43 PM
After a huge timeframe I return to my writing activity starting a series of articles about Windows Phone 7 for SilverlightShow website. During this time I've find the time to develop many samples for this device to prepare some speeches and I've created two applications for the marketplace. The intent of the new series is to collect a number of articles, starting from scratch up to the very complicated subjects and I've started today with the very first and basic article about how to get start ...
by Andrea Boschin via Silverlight & XAML Playground on 11/25/2010 11:07:04 PM
If you evere tryied to localize a Silverlight application, you have found for sure that it is not a straighforward task. Like all the other .NET tecnologies the Silverlight projects has resource files and you can create satellite assemblies to contains culture specific strings. But the problem is that it is not so easy to bring this string to the interface. When you create a resx file Visual Studio generates a code file with a class ready to be used to read the strings. You can also choose to ...
by Andrea Boschin via Silverlight & XAML Playground on 10/29/2010 10:45:18 PM
There is not any doubt, the words I read today in this article and the complete lack of Silverlight during the PDC 2010 has been for me an hard blow. I put a great part of my work in this technology, I immediately recognized as my best friend for fast and reliable developing of applications. And I'm still convinced about this argument, also after the fashion of HTML5 has taken the scene few months ago and now that it has been promoted to a primary actor of the most important conference of Micros ...
by Andrea Boschin via Silverlight & XAML Playground on 10/18/2010 12:03:08 AM
Few hours ago I released a new project on Codeplex called Silverlightbox. The purpose of this project is to create a replacement for the javascript lightbox, used widely in many websites to display images and slideshows. The project works adding a silverlight overlay to the page that is showed when an hyperlink to an image is hit. The Silverlightbox I released is compatible with the javascript lightbox. You can easily change the scripts of lightbox with my scripts and it works seamless without ...
by Andrea Boschin via Silverlight & XAML Playground on 10/15/2010 11:40:05 AM
Notice: I've added the new category "WP7 Fast Tips" to collect fast tips I found while developing my Windows Phone Applications. You Don't expect only great tips in this category but also simple things I need fo remember or I found with some difficulties :) Working on an application I hope to publish soon on the marketplace, I have the need to save an image from a WriteableBitmap instance into a Jpeg file. It was not an easy search but finally I found a couple of methods, added as ...
by Andrea Boschin via Silverlight & XAML Playground on 10/14/2010 9:53:37 PM
Silverlight Firestarter is a global event, stremed from Microsoft and presented by Scott Guthrie. During the event you can follw interesting sessions about Silverlight, k questions ad be in touch with your favorite technology. It is an important event you cannot miss! When: Thursday, December 2, 2010 8am to 5pm PT Where: Microsoft corp, Redmond or Streamed Online To register for the event follow this link and apply for in person or online registration form http://www.silverlight.net/ne ...
by Andrea Boschin via Silverlight & XAML Playground on 9/3/2010 4:38:49 PM
Many times I have to deal with enumerated values with databinding, and often this requires the writing of a converter to map the enum to something else. As an example you can have a Status enum and you need to transform it to a color (or a brush) in the UI, or you have a series of values from the enumerator and need to change it to an image when it is presented to the user. Finally these days I found a generic solution to these problems that let me create a mapping from a value (an enume ...
by Andrea Boschin via Silverlight & XAML Playground on 8/19/2010 10:48:02 PM
Some time ago I've received a copy of the book "Microsoft Silverlight 4 Data and Services Cookbook" and finally I was able to read it during my recent holidays. So I decided to write this brief review to suggest you to give it a chance, because I found this book is really interesting for someone need to start learning Silverlight 4.0. The book is a sort of collection of recipes, that describes some use cases of Silverlight applications that give a good framing for various aspect of ...
by Andrea Boschin via Silverlight & XAML Playground on 4/27/2010 4:30:52 PM
Usually the order of elements in a collection is something one does not feel to be important. We have plenty of methods in the Framework to order things and now that there is LINQ to Objects the need to sort something is really matter of seconds. Since the introduction of LINQ the main problem is that you have many cases where a few lines of code are adding really complex iteration logic and often this hurts performances when the count of milliseconds is something important. In these days I h ...
by Andrea Boschin via Silverlight & XAML Playground on 3/15/2010 7:07:30 PM
I confess I wrote the code of this example few months ago, when only Silverlight 3.0 was on the scene, and I retained it for me because it was a beautiful example but not really useful. Since it uses a socket connection it is a little bit complicated to use it in real world scenario due the fact it needs a policy server, and it is restricted to few number of ports that does not have anything to do with VNC standard ports. Finally, when I got the first bits of Silverlight 4.0 I decided it wou ...
by Andrea Boschin via Silverlight & XAML Playground on 3/15/2010 7:07:07 PM
I think all of you are aware of the new useful features of Silverlight 4.0 beta released last November. I'm referring to a bunch of new improvements, affecting the out of browser applications, starting from the full-trust capabilities to the new Notification Window, and some little changes to the configuration of the window. The new release candidate of Silverlight 4.0 bring some news to the out of browser applications. Until now we have a very little control over the window containing the app ...
by Andrea Boschin via Silverlight & XAML Playground on 3/15/2010 7:06:42 PM
I'm pretty sure you agree with me if I say that namespaces in XAML are the way to the hell. I mean the intricated jungle of xml namespaces, clr namespaces and prefixes you have to handle in a medium application. Every time you add a new control in the XAML, when it come from a different namespace, Visual Studio try to guess a good name for the prefix to use in XAML tags, and obviously it goes wrong. The problem comes from the need of having a reference to an Assembly containing the clr namespa ...
by Andrea Boschin via Silverlight & XAML Playground on 1/12/2010 11:41:48 PM
The team of silverlightshow.net announced today the first eco-contest. Obviously Silverlight is the focused technology but I really love the argument of the contest. The partecipants are invited to propose an application that will spread the word about climate change. After a failed of Copenaghen summit where the biggest and powerful countries have not been able to reach an agreement about the save of our planet there is for sure the need to embrace the cause and let people to be aware of this ...
by Andrea Boschin via Silverlight & XAML Playground on 1/2/2010 10:42:07 PM
When I wrote my article about local connections last year, I received many questions about writing application that communicate each other with this protocol. The reason for this request is that many people believe that Silverlight being a good platform for game developers due to its great graphical features and its simplicity, so a lot of them want to implement some kind of communication for on-line collaborative games. Local connections have not been made for this kind of usage because them a ...
by Andrea Boschin via Silverlight & XAML Playground on 12/16/2009 10:14:18 PM
The programming with the MVVM pattern often requires a proliferation of types because there are more Views that need a ViewModel than you might think. You can think that you need to associate a ViewModel only to simple blocks of your user interface, but while you are writing code you often understand that there are other cases where a ViewModel is required. As an example while populating a DataGrid binding simple entities to the grid is not good idea. A single row of a grid not only conta ...
by Andrea Boschin via Silverlight & XAML Playground on 11/18/2009 6:22:15 PM
Download Sample Code: SilverlightPlayground.SL4BetaTestConsole.zip (89K) During the Keynote of the PDC 2009 a new beta of Silverlight has been announced and made available. I think very few people did expect the early release of the version 4.0, and if you think in terms of number of new features compared with the time passed since the RTW of Silverlight 3.0 - only four months - you understand the big work made by one of the most prolific teams of Microsoft. In the latest month I could ...
by Andrea Boschin via Silverlight & XAML Playground on 11/13/2009 1:32:04 AM
Some weeks ago I've worked on an exercise originally started to try writing a complete application with full Model-View-ViewModel pattern. I've created the application with Visual Studio 2008, Prism to integrate missing features and Ria Services July CTP to get access to a SQL Server 2008 Database. The application is a little time tracker, and I've decided to attach it to this post because it was very useful to me to understand problems and missing things about the MVVM pattern. In the next ...
by Andrea Boschin via Silverlight & XAML Playground on 11/6/2009 11:36:01 AM
Using a Ria Services Class library to collect DomainServices and DomainContexts in a solution is a good practice because everyone know the value of having classes separated in projects instead of having them in the web project. If you try to create this kind of project and then you add an Authentication Domain Service with the July 2009 CTP of Ria Services you will find two major drawbacks. First of all you will notice the generated code does not contains a RiaContext class. RiaContext is the ...
by Andrea Boschin via Silverlight & XAML Playground on 10/23/2009 12:46:00 AM
The last tip I would like to propose is a tecnique to avoid a single client machine connect multiple times to the same polling server. This may be the case when the user starts two or more instances of the browser or open the same page in multiple tabs. In this scenario may be unuseful to have every page connected to the server. In Silverlight 3.0 there is a way to check when a plugin has been loaded many times. When you try to create a LocalReceiver with the same name from two instances you get ...
by andrea.nospam@nospam.boschin.it (Andrea Boschin) via Silverlight & XAML Playground on 7/10/2009 5:45:00 PM
Since the first release of WPF the framework contains a component called CollectionViewSource. The CollectionViewSource allow developer to apply sorting, filtering and grouping to in-memory collections of objects. This component is very useful when small collections (up to hundreds of items) is loaded in memory and need to give a better experience to the user. Some months ago I provided an implementation of the CollectionViewSource for Silverlight 2.0. I worked hard to implement the componen ...
The paradigm behind REST services is very fascinating while it allow to manipulate resources over the network relying to Uri and Http Methods. For a few of you that are not aware of what REST means I suggest to think at the web because it is the more REST thing you know. When you are pointing your browser to a "resource" on the Internet, for example a product in a ecommerce website, you will write an Url in the browser that univocally identify the product. You now can imagine to use H ...
Some months ago, a couple of minutes after the first beta of Silverlight has been released, I've posted an article explaining how to configure the new Out of Browser feature in Silverlight 3.0. Now, just after the release of the final bits, I need to return back on the argument because something has changed during this time due to additional features and modification to the API I've explained. What has changed and What has been added. There is not any substantial change to the functi ...
by andrea.nospam@nospam.boschin.it (Andrea Boschin) via Silverlight & XAML Playground on 7/9/2009 10:16:53 PM
Crawling the Internet there are many samples about how to write commands for the Composite Application Guidance, aka Prism v2.0. One of my favorites is the Erik Mork's podcast. I figure out the first time you see how many code you need, to write a working command you are really astonished. This also happened to me. But if you analyze the code you will see that the skeleton of a command is always the same, and you need to change only some names and types to have it working on different events. ...
The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.