Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Windows Forms Action Framework [modified]

Windows Forms Action Framework [modified]

Scheduled Pinned Locked Moved C#
csharpjavahtmlwinformscom
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Donkey Master
    wrote on last edited by
    #1

    One thing I like in Java is that their UI elements can all be interconnected around an Action object. You create an AbstractAction with an Icon and a description string, and then you can associate it with any controls, which will all have the same action when activated (click a button, select a menu item, click a toolbar button, etc...), have the same description, and are all enabled and disabled together, all that through the Action object. I haven't tested to see if changing the icon and the description also cascades. Is there a similar functionality in C# 2.0? Did someone write some class with this functionality? I realize that it's not very hard to code by oneself, but if I can use a proven implementation, or work with someone else, all the better. EDIT : precised that I want .NET 2.0 This has been added to the framework in C# 3.0, but I must use .NET 2.0

    "Computer Science is no more about computers than astronomy is about telescopes." - Edsger Dijkstra

    modified on Tuesday, October 14, 2008 12:01 PM

    S 1 Reply Last reply
    0
    • D Donkey Master

      One thing I like in Java is that their UI elements can all be interconnected around an Action object. You create an AbstractAction with an Icon and a description string, and then you can associate it with any controls, which will all have the same action when activated (click a button, select a menu item, click a toolbar button, etc...), have the same description, and are all enabled and disabled together, all that through the Action object. I haven't tested to see if changing the icon and the description also cascades. Is there a similar functionality in C# 2.0? Did someone write some class with this functionality? I realize that it's not very hard to code by oneself, but if I can use a proven implementation, or work with someone else, all the better. EDIT : precised that I want .NET 2.0 This has been added to the framework in C# 3.0, but I must use .NET 2.0

      "Computer Science is no more about computers than astronomy is about telescopes." - Edsger Dijkstra

      modified on Tuesday, October 14, 2008 12:01 PM

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      There's WPF commands. MSDN docs: http://msdn.microsoft.com/en-us/library/ms752308.aspx[^] Microsoft blog: http://www.microsoft.com/belux/msdn/nl/community/columns/jdruyts/wpf_commandpattern.mspx[^] Article here on CP: http://www.codeproject.com/KB/WPF/WpfCommandPatternApplied.aspx[^] Josh talking about them: http://joshsmithonwpf.wordpress.com/2008/03/18/understanding-routed-commands/[^]

      Simon

      D 1 Reply Last reply
      0
      • S Simon P Stevens

        There's WPF commands. MSDN docs: http://msdn.microsoft.com/en-us/library/ms752308.aspx[^] Microsoft blog: http://www.microsoft.com/belux/msdn/nl/community/columns/jdruyts/wpf_commandpattern.mspx[^] Article here on CP: http://www.codeproject.com/KB/WPF/WpfCommandPatternApplied.aspx[^] Josh talking about them: http://joshsmithonwpf.wordpress.com/2008/03/18/understanding-routed-commands/[^]

        Simon

        D Offline
        D Offline
        Donkey Master
        wrote on last edited by
        #3

        Oh, cool. Is there anything in .NET 2.0, though? (I forgot to mention that, sorry)

        "Computer Science is no more about computers than astronomy is about telescopes." - Edsger Dijkstra

        S 1 Reply Last reply
        0
        • D Donkey Master

          Oh, cool. Is there anything in .NET 2.0, though? (I forgot to mention that, sorry)

          "Computer Science is no more about computers than astronomy is about telescopes." - Edsger Dijkstra

          S Offline
          S Offline
          Simon P Stevens
          wrote on last edited by
          #4

          Can't think of anything. (That doesn't mean that there isn't. the framework is too big for me to remember everything). Last time I wrote an in .net 2.0 thought I wrote my own command handling framework, which I used on several projects.

          Simon

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups