Rubens Blog
FishEye effect in Silverlight and WPF 
Wednesday, May 20, 2009, 10:30 AM
Posted by Ruben Steins
Charles Petzold has an interesting blogpost on creating the fisheye effect on a row of buttons -similar to that of the OS X dock- both in WPF and in Silverlight. The WPF version was allready explained by him in his Applications = Code + Markup book, which I'm currently re-reading with a vengeance. The Silverlight version can't be completely done in markup.



Petzold is very thorough, which I've come to expect of him and meticulously writes down every improvement he makes to his code and markup. Awesome post.


add comment ( 11 views )   |  permalink   |  related link   |   ( 3 / 182 )
Evi Steins - New world citizen! 
Saturday, May 9, 2009, 10:50 PM
Posted by Ruben Steins
Evi Steins was born on 7.May 2009. She weighed in at 3450 grams which is about half a stone if your using some crazy non-metric system :)





She's in good health and keeps us awake all through the night, but we feel blessed nevertheless. She was born almost two weeks past her due date.

So, this adorable little girl will be keeping me off WPF for some time more, I guess.
3 comments ( 42 views )   |  permalink   |   ( 3.7 / 123 )
Less-than-daily WPF... but for a good reason! 
Thursday, April 16, 2009, 08:38 AM
Posted by Ruben Steins
The next couple of weeks I'm not going to post anything on this blog. My girlfriend and me are in the process of expanding our family and in the next two weeks I expect our firstborn to arrive. This means I don't have a lot of spare time to do WPF, Silverlight or anything else .NET related (except in my job of course).

So, I hope to see you all back in about a month or two. I promise I will keep you posted about the baby once in a while :)

Cheers,
Ruben
3 comments ( 16 views )   |  permalink   |   ( 3.1 / 86 )
Glass Effect in WPF and Scrollable Fiction Canvas for Silverlight 
Friday, April 10, 2009, 10:22 AM
Posted by Ruben Steins
When I was looking at this article and the Scrollable Friction Canvas For Silverlight, a joint venture by Sasha Berber and Jeremiah Morrill I came across another post on the Jeremiahs blog in which he showed off his CustomBehavior for WPF.

This glass effect looks amazing!


add comment ( 28 views )   |  permalink   |  related link   |   ( 3 / 88 )
[Non-WPF] I finally get it now... yield! 
Thursday, April 9, 2009, 10:42 PM
Posted by Ruben Steins
While working through the excellend first chapter of the new APS.NET MVC book, I came across the yield keyword. Although I know I should get to terms with it, I was never able to really grasp what the benefits of using it were. Thank heavens this guy has explained it so well on his blog. The MSDN examples pale in comparison to the clear and easy with-and-without yield examples Yason Young gives. From the comments on the posts, it's clear I am not alone in the yield-fearing world :)

Update: today I even contrived my own little test for yield:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
List<int> integers = new List<int>() { 3, 4, 8, 14, 24, 28, 52, 11, 33, 12,6 };
Program p = new Program();

TwoFilter filter2 = new TwoFilter();
ThreeFilter filter3 = new ThreeFilter();

int count = 0;
foreach (int i in filter3.Process(filter2.Process(integers)))
{
Console.WriteLine(i);
count++;
}
Console.ReadKey();
}
}

public interface IFilter<T>
{
IEnumerable<T> Process(IEnumerable<T> input);
}

public class TwoFilter : IFilter<int>
{
public IEnumerable<int> Process(IEnumerable<int> input)
{
foreach (int i in input)
{
if (i % 2 == 0)
{
Console.WriteLine("Called div 2 for " + i);
yield return i;
}
}
}
}

public class ThreeFilter : IFilter<int>
{
public IEnumerable<int> Process(IEnumerable<int> input)
{
foreach (int i in input)
{
if (i % 3 == 0)
{
Console.WriteLine("Called div 3 for " + i);
yield return i;
}
}
}
}
}


This uses some simply chaining to determine for each integer if its divisble by 2 and by 3. The nice thing is that the when you break out of the call loop (in Main) at any point, the Process method has not been called for any integer in the collection after that point, which could be a possible performance gain. Also it save you the trouble of creating temporary collections in each of the process methods to store the intermediate resultset in. All in all, pretty nifty, this yield.
add comment ( 1 view )   |  permalink   |  related link   |   ( 2.9 / 44 )

<<First <Back | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Next> Last>>