Hello everyone,
today I want to share an implementation I’m using in my personal prototyping-Framework for Silverlight. This is important to mention, because I have tested it only for “works” but not including any productive parameters like memory-usage or processing-time.
The meaning of a prototyping-framework for me is to get thinks working as quick as possible, to show the outcome to my customer. There are some things I need very often, and so I’m using base-classes a lot.
Click here to read more.. »
Hello everyone,
I originally planed to write a blog-post about the right way to localize Silverlight Apps. While researching I came across two really good posts about that topic already. So instead of writing the same stuff again, I follow an extended D.R.Y.-Principal ( I might call it D.R.O.P – Don’t repeat other people
) and point you in the right direction instead
A short but clear post about Localization was written by Patric Schouler on dotnet-redzone.blogspot.com.
If you like more detail and "Hands-On"-Experience have a look at the Post "Localizing Business Application" by Brad Adams.
Keep on improving !
Sascha
Hi everyone,
just found a nice Silverlight game for Phone 7. You can play it in the browser, don’t need a phone or emulator.
Check out DroppyPop
Cheers
Sascha
I like using Base-Classes for any kind of “Class-Group”. Very prominent groups are Models and ViewModels in Silverlight-Applications.
The ViewModel-Baseclass can hold any functionality, that applies to every ViewModel inheriting from it and, if we are talking about Generics, can be very convenient to use.
For example, if I want to apply the factory-pattern to my ViewModels and want every Model to have a static Create-Method I can simply implement this Method in the Base-Class.
public class ViewModelBase
{
public virtual ViewModelBase Create()
{
return new ViewModelBase();
}
}
Of cause, without Generics we are limited to the return-Type. We could now override this method in every specific ViewModel to at least return the right ancestor of ViewModelBase. An easier way is, to use Generics for this case. The class could look like this :
public class ViewModelBase<TViewModel> where TViewModel : ViewModelBase
{
public virtual TViewModel Create()
{
return Activator.CreateInstance(typeof(TViewModel));
}
}
Now we can simply create our new specific ViewModel like this
public class MyViewModel : ViewModelBase<MyViewModel>
to get what we want generically.
Another possible scenario would be the following. We know, every ViewModel contains a Collection of Models, all inheriting from a class called ModelBase. we could extend out code the following way:
public class ViewModelBase<TViewModel> where TViewModel : ViewModelBase
{
public virtual TViewModel Create()
{
return Activator.CreateInstance(typeof(TViewModel));
}
public List<ModelBase> MyList {get;set;}
}
or, the better way, we could extend our Generic header to be type safe.
public class ViewModelBase<TViewModel, TChildModel>
where TViewModel : ViewModelBase
where TChildModel : ModelBase
{
public virtual TViewModel Create()
{
return Activator.CreateInstance(typeof(TViewModel));
}
public List<TChildModel> MyList {get;set;}
}
Defining a Class by
public class MyViewModel : ViewModelBase<MyViewModel, MyModel>
Like always, if we talk about inheritance, you should avoid to go too far with that. I implemented a Framework I use for rapid prototyping where a lot of things are done in the base-class via reflection, but in a productive environment its not always what you want. Plan your development as precise as possible.
- What do you want to be individually implemented by each ViewModel ?
- When is it a good thing to implement it in the Base-Class ?
- How confusing is you inheritance for other developers ?
Good Luck
I read very often things like “Should work, cause its downward compatible”. But I’m too long in the business to trust sentences like this – so basically If I write a Silverlight 3 App for a customer I want to test it with the SL 3 Runtime, if I play around with the new SL 4 Features, I obviously need SL 4 Runtime. Are you like me ? Don’t you like VMs for these small requirements ?
Click here to read more.. »
Silverlight 4, Various Februar 16th 2010
Many of you will know, that Silverlight 3 has a new class called WritableBitmap. We can now create Bitmaps on-the-fly. At the moment one interest of mine is Silverlight Game-programming and I thought, this class may also help to build pixel based Collision-Detection.
Guess what, I found an article from Andy Beaulieu doing exactly that:
" Improved HitTest Method for Silverlight 3" from Andy Beaulieu
Good afternoon,
one of my expectations as a Software Developer in 2010 is, that the WCF RIA Services for Silverlight will become a huge thing. So I did some research, and found a nice webcast by Ronnie Sauermann from Microsoft Switzerland. I met him during a project I did last summer, and he has a very good way to explain things. check it out! I unfortunately found no way to directly bookmark the video. So click the link and navigate down to Ronnies Video about RIA Services.
Video from Shapes ‘09 about WCF RIA Services
WCF WIA Services Januar 2nd 2010
There is a new Kid in SL-IDE-Town, and its called Eclipse4SL. To be honest, it isn’t really new, cause development started in 2008. But end of 2009 they released Version 1.0.
The Features of this Version are:
- Silverlight 2.0 support
- C# code editor with syntax colorization, keywords and template code completion assist
- Automatic Build & Run
- Configurable Web application launch facilities
- Silverlight Project System and Silverlight Compiler: both an advanced project system for creating Silverlight applications and media experiences.
- XAML Editor & Preview: advanced, standards-compliant XAML editor with code hinting and code completion features which helps detect and correct coding errors.
- Move and Rename refactoring
- Advanced Media Features
- Cross Platform Capabilities (Mac version)
- Complete user documentation & Prescriptive Tutorials
- Defects & Regression Testing
- Developer Usability Testing
Version 2.0 is planned for Spring 2010. This is the roadmap:
- Silverlight 3.0 support
- Completion of re-organization Silverlight development environment
- Completion of the Extensibility, Support for Multiple Projects
- Improvements to Mac Platform
- Completion of Silverlight 3.0 Runtime Support "out of browser"
More Information can be found on the projects website www.eclipse4sl.org
If you are a Mac-User, there is also a plug-in for you. Check out the Microsoft Interop Website for Eclipse4SL.
Hello everyone,
I wish all of you a relaxing and successful 2010. See you on the other side
)
Sascha
Various Dezember 31st 2009
I had a little inspiration during the holidays – tried it out – and it worked.
With Internet Explorer 8 Microsoft introduced a new feature called Webslices. Little pieces of information within your browser-bar (most commonly) about site-updates.
Now I tried to put a Silverlight app into a Webslice.
Herefor I created a new Silverlight App with a testpage like this (created automatically)
<form id="form1" style="height: 100%;">
<div id="silverlightControlHost">
<object width="100%" height="100%" type="application/x-shockwave-flash">
<param name="source" value="ClientBin/SilverlightWebslice.xap" />
<param name="onError" value="onSilverlightError" /><param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
</object></div></form>
In my Silverlight-App I placed a Textblock saying “Welcome to my Silverlight Webslice”.
<Grid x:Name="LayoutRoot">
<TextBlock Text="Welcome to my Silverlight Webslice"></TextBlock>
</Grid>
And then, in default.aspx I put the Webslices-Code
<form id="form1">
<div id="SliceID" class="hslice" style="display: none">
<span class="entry-title">Silverlight Slice
<a style="display: none" rel="entry-content" href="SilverlightWebsliceTestPage.html">Alternative</a>
</div></form>
and voila, a silverlight Webslice.

Have fun playing arund with it
)
Before I forget, there is an alternative for Firefox Browser called WebChunks. Unfortunately it doesn’t work for the current Version at the moment, hope the developer will keep on working on it.
Sascha
Various Dezember 31st 2009