Tech Off Thread

25 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Silverlight 4 : ItemSource vs DataContext

Back to Forum: Tech Off
  • User profile image
    vesuvius

    turrican said:
    spivonious said:
    *snip*

    "...moving from Click event handlers to Commands..."

     

    Yes, that is REALLY hard for me to understand right now. Trying to find good resource on it to learn more. It's a big shift for me but a necessity to learn it I guess.

    Commands are very easy to understand, in MS word you have a cut/copy/paste commands  (it is a design pattern) that can be called from a toolbar button, context menu or menu option. Rather than having three seperate click events you have the notion of a command, that can be called from any place.

     

    Try get a copy of the Adam Nathan book as that is very good for people that are coming to WPF from ASP.NET or winforms. The hard part is getting to create delegate/relay commands, that video I have just linked to has all this information.

  • User profile image
    turrican

    vesuvius said:
    turrican said:
    *snip*

    Commands are very easy to understand, in MS word you have a cut/copy/paste commands  (it is a design pattern) that can be called from a toolbar button, context menu or menu option. Rather than having three seperate click events you have the notion of a command, that can be called from any place.

     

    Try get a copy of the Adam Nathan book as that is very good for people that are coming to WPF from ASP.NET or winforms. The hard part is getting to create delegate/relay commands, that video I have just linked to has all this information.

    Yeah... I see.

     

    That video helped a lot. I'll try to buy a copy of his book later.

  • User profile image
    vesuvius

    turrican said:
    vesuvius said:
    *snip*

    Yeah... I see.

     

    That video helped a lot. I'll try to buy a copy of his book later.

    Also feel free to have a look at these pretty popular tutorials from moi if you really want to know how to do this properly.

  • User profile image
    turrican

    vesuvius said:
    turrican said:
    *snip*

    Also feel free to have a look at these pretty popular tutorials from moi if you really want to know how to do this properly.

    Coooooooooool!

     

    One issue though, in that video... they use 3rd party libraries / DLLs ... which is not too good for me imho. I usually never use 3rd party stuff in order to not be dependant on others.

  • User profile image
    stevo_

    turrican said:
    vesuvius said:
    *snip*

    Coooooooooool!

     

    One issue though, in that video... they use 3rd party libraries / DLLs ... which is not too good for me imho. I usually never use 3rd party stuff in order to not be dependant on others.

    Well, any dependency you have such as .NET framework DLL's are still a dependency.. you should get over this, I don't think there's a single project I work on that doesn't use 3rd party libs of some sort.

     

    If you try and recreate everything, you'll create unfortunately inferior results (not specifically through lack of ability), that took longer to make.

     

    Like anything, the lesson is 'balance'..

  • User profile image
    turrican

    stevo_ said:
    turrican said:
    *snip*

    Well, any dependency you have such as .NET framework DLL's are still a dependency.. you should get over this, I don't think there's a single project I work on that doesn't use 3rd party libs of some sort.

     

    If you try and recreate everything, you'll create unfortunately inferior results (not specifically through lack of ability), that took longer to make.

     

    Like anything, the lesson is 'balance'..

    The more suppliers, the more complicated, the more dependant. At some places, using more than one supplier isn't even allowed.

     

    I do not disagree that they can do things better since they specialize on it... but I still dislike using 3rd party stuff. Weird thing is that Microsoft been spending money on crappy stuff, they should gobble up some of these great libs and put it into .NET or something. It would help .NET and also help the people who made these things... and also benefit developers. win win win.

     

    ...maybe I'm a dreamer.

  • User profile image
    spivonious

    turrican said:
    spivonious said:
    *snip*

    "...moving from Click event handlers to Commands..."

     

    Yes, that is REALLY hard for me to understand right now. Trying to find good resource on it to learn more. It's a big shift for me but a necessity to learn it I guess.

    A book that I got a lot out of is Pro WPF in C# 2008 from Apress. If you're doing SL, you may want to see if they have a book on SL, but a lot of WPF knowledge is directly applicable to SL.

     

    As far as Commands, I use Josh Smith's RelayCommand class to define a method for what the command should do and a method to determine if the command can be run. Then I bind an instance of that command to any object in the interface that uses it. With this approach it's possible to have a completely empty code-behind, which makes maintenance of the interface a lot easier because it is now completely visual. All of the functionality is contained in other classes.

     

    I tend to avoid third-party libraries too, unless I need something that I couldn't throw together myself. For me, it's easier to work with objects I designed rather than hope the library works with the specific case I need it for.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.