Archive for September, 2009

jQuery and AIR – Moving from web page to application (2)

As a followup to my previous entry, I discuss modifying my Hangman game to make use of a database of words.

Mega Freebies Day : Winners Announced


Few weeks ago we announced the Mega Freebies Day, and celebrated with a new design for Noupe. 15 generous sponsors offered to give away premium web design-related products, services & licenses just for you guys.

Over 450 wonderful readers participated in the giveaway. And the winners were randomly selected and are now announced in this post.

And the winners are…

1. ThemeForest
  • #51495 | Matty
  • #51500 | Jelani Harris
  • #51501 | Nina
  • #51508 | Ahmad Alfy
  • #51519 | Marko Randjelovic
  • #51525 | Mustafa Quilon
  • #51535 | coldchiliandhotchilly
  • #51555 | Jesse McFarlane
  • #51586 | Francois
  • #51620 | Chris Robinson
2. Page Flip
  • #51629 | WpthemesMall
  • #51650 | Heather St. Marie
3. Elegant Themes
  • #51652 | yasser
  • #51686 | Blurt Brumme
  • #51732 | Peter Steen Høgenhaug
4. SnobbySlice
  • #51759 | karansinh
5. Themegalaxy
  • #51803 | Paul
  • #51837 | adam
6. Designious
  • #51730 | Amy L
  • #51662 | abhijeet
  • #51505 | Tom
  • #51693 | redwall_hp
  • #51782 | Boci
7. Obox-Design
  • #51742 | webbografico
  • #51798 | Stefan Alexandru
  • #51831 | Rommel Miraflores
8. Gomedia
  • #51696 | Abhin
  • #51968 | Alex
  • #52158 | Pablo
9. Artbox7
  • #52214 | manSur
  • #52220 | chaitanya vrk
  • #52248 | DanHillesheim
  • #52360 | paburmester
  • #52383 | Jim
10. Stock Graphic Designs
  • #52863 | Magdy
11. Flashotaku
  • #51556 | Darin
  • #51610 | Jim Raymonds
  • #52005 | Teo Farro
12. Printprintprint
  • #51556 | Dipak Patel
  • #51871 | philip
13. Bizcard
  • #51560| Michael Castilla
  • #51858 | Garry
14. Gabfirethemes
  • #51517 | Alexandru Pitea
  • #51572 | Bakhtier
  • #51606 | Dnyanesh
  • #51582 | RussellUresti
  • #51591 | Rob
  • #51601 | Felipe Arima
15. Gorilla Themes
  • #51628 | Phyza
  • #51630 | AntiheroKing
  • #51687 | Rohan

Thank you to everyone who participated and congratulations to all the winners.

Related posts:

  1. Premium WordPress Themes Giveaway: Winners Announced
  2. 25 Winners Announced for Stock Graphic Designs Giveaway!
  3. Premium WordPress Themes Giveaway: Winners


Behaviors vs Subclassing in Silverlight

As a Silverlight developer, when you want to add functionality to an existing control, you have two main options as I see it (if you want to get reuse from your code). You can either subclass the control or, as of Silverlight 3,  you can write a behavior for it. For example, one of the requests for the current Silverlight application that I’ve been working on was to have the TextBox select all the text when you tabbed to it or clicked in it. We can easily add this functionality using both of the above methods:

Here is how this could be done using subclassing:

public class SelectAllTextBox : TextBox 
{
    public SelectAllTextBox()
    {
        this.GotFocus += new RoutedEventHandler(TextBox_GotFocus);
    }

    private void TextBox_GotFocus(object sender, RoutedEventArgs e)
    {
        this.SelectAll();
    }
}

And here is how you would write this as a behavior:

public class SelectAllBehavior : Behavior<TextBox>
{
    protected override void OnAttached()
    {
        base.OnAttached();
        AssociatedObject.GotFocus += new RoutedEventHandler(AssociatedObject_GotFocus);
    }

    void AssociatedObject_GotFocus(object sender, RoutedEventArgs e)
    {
        ((TextBox)sender).SelectAll();
    }
}

The behavior has one more line of code and the added requirement of adding a reference to System.Windows.Interactivity.dll from the Blend 3 SDK. The bigger difference is how the code looks in our view when we add the control to it.

The subclassed control looks like (where ctrls is the controls namespace of our subclassed control):

<ctrls:SelectAllTextBox Text="{Binding MyText}" />

And the behavior looks like (where i is the System.Windows.Interactivity namespace and b is our behavior’s namespace):

<TextBox Text="{Binding MyText}">
    <i:Interaction.Behaviors>
        <b:SelectAllBehavior />
    </i:Interaction.Behaviors>
</TextBox>

Obviously the behavior is more verbose in this case than the subclassed approach.

Since both of these approaches work, which is the better approach? I think the subclassing is the easier approach, but I think the behavior would be the recommended approach. The reason is that I can build my SelectAll behavior today and then down the road build a different behavior and then selectively apply them to my TextBoxes as appropriate. However, if use the subclass approach I would automatically get the new behavior on all my controls which might not be what I wanted. It also means that if someone builds a better TextBox that I want to use that I would have to try to subclass that control, but with the behavior I could just apply it to the new control.



Fixed: “An internal build error has occurred” with FB3 & Galileo

James Ward surprised us today with a patch for Flex Builder 3 that makes it work with Eclipse Galileo SR1. James solved the dreaded "An internal build error has occurred" problem. His solution was to replace ProblemManager with his...

New & Free Social Media Icon Set For Your Blog


In this post we release a new and free Social Media Icon Set: A Custom Icon Set, specially designed in a high quality and unique style for our readers that will hopefully meet your expectations and will come in handy in your projects.
6 beautiful and clean icons: New RSS, Twitter, Del.icio.us, Stumble Upon, Facebook and Email. This set was designed by IconShock and released exclusively for Noupe and its readers.

Social Media Icon Set

The files are transparent PNGs, and the source file (.psd) is available for download as well (see the links below). The set is completely free and may be used for any private or commercial project without any restrictions.

Download the set (.zip, including .psd & .ai source files, 5.9 Mb)

Download the set (.zip, including .png source files, 1.2 Mb)

Related posts:

  1. 40 (NEW) High-quality and Free Icon Sets
  2. 50 Most Beautiful Icon Sets Created in 2008
  3. 50 Free High-Quality and “New” (X)HTML/CSS Templates


  • Sponsored Links

  •  

    September 2009
    M T W T F S S
    « Aug   Oct »
     123456
    78910111213
    14151617181920
    21222324252627
    282930  
  • .

    Copyright © 1996-2010 Answer My Query. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress